MissingOptionalLibraryError when trying to import ibmq

26 views Asked by At

When trying to load ibmq, from qiskit import IBMQ I run into the following error, even after running pip install qiskit-ibmq-provider

Unexpected exception formatting exception. Falling back to standard exception
Traceback (most recent call last):
  File "c:\Users\dhruv\AppData\Local\Programs\Python\Python311\Lib\site-packages\qiskit\__init__.py", line 169, in __getattr__
ImportError: cannot import name 'ibmq' from 'qiskit.providers' (c:\Users\dhruv\AppData\Local\Programs\Python\Python311\Lib\site-packages\qiskit\providers\__init__.py)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\dhruv\AppData\Roaming\Python\Python311\site-packages\IPython\core\interactiveshell.py", line 3442, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "C:\Users\dhruv\AppData\Local\Temp\ipykernel_27528\2346559650.py", line 3, in <module>
    IBMQ.load_account()
    ^^^^^^^^^^^^^^^^^
  File "c:\Users\dhruv\AppData\Local\Programs\Python\Python311\Lib\site-packages\qiskit\__init__.py", line 183, in __getattr__
qiskit.exceptions.MissingOptionalLibraryError: "The 'qiskit-ibmq-provider' library is required to use 'IBMQ provider'. You can install it with 'pip install qiskit-ibmq-provider'."

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\dhruv\AppData\Roaming\Python\Python311\site-packages\IPython\core\interactiveshell.py", line 2057, in showtraceback
    stb = self.InteractiveTB.structured_traceback(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\dhruv\AppData\Roaming\Python\Python311\site-packages\IPython\core\ultratb.py", line 1118, in structured_traceback
    return FormattedTB.structured_traceback(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\dhruv\AppData\Roaming\Python\Python311\site-packages\IPython\core\ultratb.py", line 1012, in structured_traceback
...
           ^^^^^
  File "C:\Users\dhruv\AppData\Roaming\Python\Python311\site-packages\executing\executing.py", line 190, in only
    raise NotOneValueFound('Expected one value, found 0')
executing.executing.NotOneValueFound: Expected one value, found 0

Does anyone have any advice?

Thanks

0

There are 0 answers