An Azure service that provides quantum computing and optimization solutions.
I managed to solve the problem by removing the cached credential file in /home/user/.azure-quantum/aad.bin and re-login using:
workspace.login()
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I'm using Python to submit a job to azure-quantum. However, in my recent attempt t login to my workspace using:
workspace = Workspace(
subscription_id="my_subscription_id",
resource_group="my_resource_group",
name="the_name",
location="eastus", )
workspace.login()
I receive the error:
json.decoder.JSONDecodeError: Extra data: line 1 column 7 (char 6)
An Azure service that provides quantum computing and optimization solutions.
Answer accepted by question author
I managed to solve the problem by removing the cached credential file in /home/user/.azure-quantum/aad.bin and re-login using:
workspace.login()
Thank you for your reply.
I did have installed the Azure Quantum Python SDK and imported the Workspace module. My code is identical to the code you posted.
The package version for azure-quantum is 0.15.2101.126941 and I'm using Python3.8.
(I also notice that there is a trailing , after the location parameter in your Workspace object definition that could possibly cause errors)
I don't think this might cause an error!
@Khaled Kelany Thanks for your interest in Azure Quantum!
Before initiating a connection to your Quantum workspace, I hope you have installed the Azure Quantum Python SDK and imported the Workspace module from azure.quantum in your py code.
I could not reproduce the mentioned error, but here is the Python code I could get to work to connect to my Azure Quantum workspace:
# File: workspace.py
from azure.quantum import Workspace
# Copy the settings for your workspace below
workspace = Workspace(
subscription_id="***", # Add your subscription_id
resource_group="Quantum-Resource-Group", # Add your resource_group
name="myquantumworkspace", # Add your workspace name
location="westus", # Add your workspace location (for example, "westus")
)
workspace.login()
And then I was able to run this with python workspace.py from my conda environment.
If you still run into issues, please help us with the package version for azure-quantum you're seeing this with.
(I also notice that there is a trailing , after the location parameter in your Workspace object definition that could possibly cause errors)
Here are some resources for your reference: