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

Failed to create QiskitRuntimeService instance if QISKIT_IBM_URL is not set #1668

Closed
ohtanim opened this issue May 10, 2024 · 1 comment · Fixed by #1688
Closed

Failed to create QiskitRuntimeService instance if QISKIT_IBM_URL is not set #1668

ohtanim opened this issue May 10, 2024 · 1 comment · Fixed by #1688
Labels
bug Something isn't working

Comments

@ohtanim
Copy link

ohtanim commented May 10, 2024

Describe the bug
When I tried to create QiskitRuntimeService instance with specifying the following 3 environment variables as documented here,
its instantiation was failed like below. It seems that we also need to specify QISKIT_IBM_URL environment variable. Is this expected behavior ?

(qiskit_runtime_1) ohtanim@ohtanim-mbp14 qiskit % python
Python 3.11.9 (main, Apr  2 2024, 08:25:04) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from qiskit_ibm_runtime import QiskitRuntimeService
>>> service = QiskitRuntimeService()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/ohtanim/qiskit_runtime_1/lib/python3.11/site-packages/qiskit_ibm_runtime/qiskit_runtime_service.py", line 124, in __init__
    self._account = self._discover_account(
                    ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ohtanim/qiskit_runtime_1/lib/python3.11/site-packages/qiskit_ibm_runtime/qiskit_runtime_service.py", line 248, in _discover_account
    account = AccountManager.get(filename=filename)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ohtanim/qiskit_runtime_1/lib/python3.11/site-packages/qiskit_ibm_runtime/accounts/management.py", line 195, in get
    raise AccountNotFoundError("Unable to find account.")
qiskit_ibm_runtime.accounts.exceptions.AccountNotFoundError: 'Unable to find account.'

Steps to reproduce

  1. Set the following 3 environments as documented:
  • QISKIT_IBM_CHANNEL
  • QISKIT_IBM_INSTANCE
  • QISKIT_IBM_TOKEN
  1. Run python code to instantiate QiskitRuntimeService

Expected behavior
Work as documented.

Suggested solutions
Update README to add QISKIT_IBM_URL or update qiskit_runtime_service.py to not refer QISKIT_IBM_URL variable.

Additional Information

  • qiskit-ibm-runtime version: 0.23.0
  • Python version: 3.11
  • Operating system: MacOS
@ohtanim ohtanim added the bug Something isn't working label May 10, 2024
@kt474
Copy link
Member

kt474 commented May 16, 2024

Yeah this appears to be a bug, url should not be required

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

Successfully merging a pull request may close this issue.

2 participants