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

401 Client Error: Unauthorized for url while trying to save my IBM quantum token #543

Open
shemanourine opened this issue Dec 20, 2024 · 0 comments

Comments

@shemanourine
Copy link

I want some data from real quantum device. So I used the following codes (which I've found in this platform only) to access it through my token.

%pip install qiskit-ibm-runtime
# do pip install qiskit-ibm-runtime first from qiskit_ibm_runtime import QiskitRuntimeService service = QiskitRuntimeService(channel="ibm_quantum", token="<I've removed the token for now>")

But I'm getting the following error
HTTPError Traceback (most recent call last) [/usr/local/lib/python3.10/dist-packages/qiskit_ibm_runtime/api/session.py](https://localhost:8080/#) in request(self, method, url, bare, **kwargs) 328 response = super().request(method, final_url, headers=headers, **kwargs) --> 329 response.raise_for_status() 330 except RequestException as ex: 9 frames HTTPError: 401 Client Error: Unauthorized for url: https://auth.quantum-computing.ibm.com/api/users/loginWithToken The above exception was the direct cause of the following exception: IBMNotAuthorizedError Traceback (most recent call last) [/usr/local/lib/python3.10/dist-packages/qiskit_ibm_runtime/api/session.py](https://localhost:8080/#) in request(self, method, url, bare, **kwargs) 348 message += f". {ex.response.text}" 349 if status_code == 401: --> 350 raise IBMNotAuthorizedError(message) from ex 351 raise RequestsApiError(message, status_code) from ex 352 IBMNotAuthorizedError: '401 Client Error: Unauthorized for url: https://auth.quantum-computing.ibm.com/api/users/loginWithToken. Login failed., Error code: 3446.'

What am I doing wrong here? I tried regenerating the token, and even uninstalled and upgraded qiskit-ibm-runtime. The main issue is I can't fully understand the error here. How can I save my account like this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant