-
Notifications
You must be signed in to change notification settings - Fork 61
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
RecursionError: maximum recursion depth exceeded #196
Comments
What other issue? Can you link it here.
The import fine for me locally, entered from a Python prompt
and many of the unit tests import that in order to seed things so the outcome is reproducible for the test. All unit tests here are passing as expected - these are run nightly. From your trace it seems to start with an import from machine learning and has nothing to do with algorithm_globals. algorithm_globals has nothing to do with machine learning so that cannot have been the start point. Since it seems to fail recursion in numpy what version are you running, have you tried updating that? Maybe try a clean environment, if you already haven't, and just install the minimum needed for what you want to run there and see. |
I had opened an issue on qiskit-ibm-runtime but jyu00 suggested I open an issue here. |
Ok I see that there now, which has been closed. |
my numpy library version is 2.0.1. |
Try installing the newest version of the 1. series of numpy i.e. 1.26.4. Qiskit ML has included a constraint to restrict numpy < 2.0 which I think was mainly due to compatibility with torch qiskit-community/qiskit-machine-learning#815 but I know 2.0 series has caused some problems for some projects so it may be worth a try with the 1.26.4 I will note that the tests run here daily across the code, with various OS and Python versions, do install 2.0.1 numpy and all the tests pass as I noted earlier with algorithms_globals being successfully imported with no such recursion error. |
Update: I just downgraded my numpy to 1.26.4 and it did work!! thanks @woodsp-ibm so very much for your help. |
Glad to hear that sorted out your issue - or at least avoids whatever the problem is. As I noted algorithms is tested here with 2.0.1 so at that level things work, but of course you are including/using more so hopefully whatever the overall problem you had with 2.0.1 will get sorted out over time - the 2.0 numpy series is pretty new so it may just need a bit for other projects to ensure things work with that. E.g. like Machine Learning which has pinned it to not use the 2.0 series due to some issue(s). Anyway as this seems to have sorted your problem, and with algorithms working afaik based on the tests that are run using it, I am going to close this. |
Environment
I am running this command:
from qiskit_algorithms.utils import algorithm_globals
and getting error:
Suggested solutions
I know another issue has been opened on this but I could not find any response for that. And that is why I opened another one. thanks
Additional Information
qiskit-ibm-runtime version: qiskit-machine-learning: 0.7.2 and qiskit: 1.1.1
Python version:3.12
Operating system: LINUX
What is happening?
I am getting
RecursionError: maximum recursion depth exceeded
error when running commandfrom qiskit_algorithms.utils import algorithm_globals
.How can we reproduce the issue?
qiskit-ibm-runtime version: qiskit-machine-learning: 0.7.2 and qiskit: 1.1.1
Python version:3.12
Operating system: LINUX
Numpy version: 2.0.1
from qiskit_algorithms.utils import algorithm_globals
What should happen?
I should be able to import the library.
Any suggestions?
No response
The text was updated successfully, but these errors were encountered: