Open laserlab opened 2 months ago
The best way to circumvent the problem for now is to use python kernel 3.9.6
We could have a look at this https://docs.quantum.ibm.com/api/qiskit/release-notes/0.45
So basically it says that the error could be due to the new changes in the Qiskit packaging structure.
If import qiskit raises an ImportError for you, your environment is in an invalid state, and versions of Qiskit 0.45/0.46 and 1.0 are both reachable, which will result in subtly broken code. You will need to create a new virtual environment, and ensure that only one of the two versions are installed. In particular, if you are intending to install Qiskit 1.0, you must have no packages that depend on qiskit-terra installed; these packages are incompatible with Qiskit 1.0 and must be updated. If you are intending to install Qiskit 0.45 or 0.46, you must ensure that you have nothing attempting to install qiskit>=1.0.
Maybe this is the reason for the above error? Although I am not sure why it works on Python 3.9.6 if that is the case.
No that’s not it. It’s about where the packages are getting installed. It’s a codespace issue.
@laserlab Would you be able to go to the terminal in the codespace (I used zsh) any type pip install qiskit to see what happens?
I had the same issue, and I got qiskit working on a code space with python 3.12.6 by manually installing it through the terminal in the codespace and refreshing the window if need be. Also helped get qiskit-aer working too.
@SchrodingersStruggle That will work but is discouraged since then we don’t all have the same environment. So the goal is to setup a codespace that works without additional manual installs
For our case it probably doesn't make much of a difference but in a broader sense does changing python kernels for qiskit affect? I am asking since there are some libraries that do not import while using the 3.9 kernels. I remember, having trouble with icecream the day it was discussed in class, last week.
I will put the snippet from my codespace here, trying to figure out how to do that.
Has this been resolved? I didn't run into the issue so maybe the requirements were changed successfully.
For unclear reasons qiskit is not found if selecting python kernel 3.12.6