0
$\begingroup$

I'm a newcomer to qiskit, when I tried to import qiskit, it followed a ModuleNotFoundError: No module named 'qiskit._accelerate'. I've tried creating a new virtual environment and re-install qiskit, but the same error popped out.

ModuleNotFoundError: No module named 'qiskit._accelerate' Using "pip list" to check if qiskit is downloaded.

Also here comes another error after commenting out the "qiskit._accelerate" in "init" : ModuleNotFoundError: No module named 'retworkx.retworkx'

It seems that there are some missing modules, but how can I figure it out? Can someone give me a hand please?

$\endgroup$
2
  • $\begingroup$ did you try to reinstall qiskit, it should solve the problem, it also happened to me before with tox -elint to pr branch, but not effect too much. $\endgroup$
    – poig
    Commented Jun 27, 2022 at 8:58
  • $\begingroup$ yes I've tried it! $\endgroup$
    – hola haha
    Commented Jun 27, 2022 at 9:00

2 Answers 2

0
$\begingroup$

current solution you can try:

  • pip install spyder-kernels if using pip/virtualenv
  • pip3 install qiskit or pip install qiskit
  • make sure "conda activate ur_env_name"

related wiki: https://github.com/spyder-ide/spyder/wiki/Working-with-packages-and-environments-in-Spyder

$\endgroup$
7
  • $\begingroup$ It doesn't work, thanks for your effort tho. $\endgroup$
    – hola haha
    Commented Jun 27, 2022 at 9:42
  • $\begingroup$ @holahaha can you open a new conda env, and install required packages like pip install qiskit and pip install spyder-kernels and see if it works. $\endgroup$
    – poig
    Commented Jun 27, 2022 at 9:45
  • $\begingroup$ I've tried it, but still doesn't work. $\endgroup$
    – hola haha
    Commented Jun 27, 2022 at 9:46
  • $\begingroup$ @holahaha did you tried reinstall spyder $\endgroup$
    – poig
    Commented Jun 27, 2022 at 9:47
  • $\begingroup$ because I search related issue on spyder github, it got 253 same cases with import problem, I tried myself, I solve it with pip install spyder-kernel $\endgroup$
    – poig
    Commented Jun 27, 2022 at 9:49
1
$\begingroup$

The problems have been solved.

The problems lie in the version of python, the version I used in the aforementioned case was 3.9.12, whereas it works as I create a new env with python 3.8.13 or 3.8.8.

It's probably related to compatibility.

@poig Thanks for your help, btw.

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.