Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import error of numpy when trying to run mixer calibration on 0.1 version of qiblab #1125

Closed
Luca-Ben-Herrmann opened this issue Dec 27, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@Luca-Ben-Herrmann
Copy link

When trying to run mixer calibration (I copied and modified the mixer calibration script that middelware uses for the 11q chip ) for the quantum machine on the qw5q_platinum using 0.1 version of qibolab I get an error with the import of numpy (see attached file). I appears that numpy is trying to import platform which does not exist.

File "/home/users/luca.herrmann/.envs/lbh_dev/lib/python3.10/site-packages/numpy/lib/utils.py", line 8, in <module>
   import platform
 File "/nfs/users/luca.herrmann/qibolab_platforms_qrc/qw5q_platinum/platform.py", line 3, in <module>
   from qibolab.channels import Channel, ChannelMap

_qw5q_platinum_mixers.log

@Luca-Ben-Herrmann Luca-Ben-Herrmann added the bug Something isn't working label Dec 27, 2024
@stavros11
Copy link
Member

Thank you for reporting this. I see from the attached logs that the mixer calibration script is executed from within the qw5q_platinum directory. This directory contains a platform.py file which I think is conflicting with an internal numpy import. Could you try moving the script to a different directory (one that does not contain any platform.py) and execute from there?

@alecandido
Copy link
Member

Indeed, platform is a standard library module. Unfortunately, Python has the (arguably bad) habit of adding the current directory to its module path...

@Luca-Ben-Herrmann
Copy link
Author

Thank you for your help, indeed the issue was that platform is a standard library module. After moving the file to a different directory as well as the additional fix by Stavros (#1127) I can now run the mixer calibration!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants