Update the Azure Quantum Development Kit (QDK) to the latest version
Learn how to update the Azure QDK to the latest version.
Prerequisites
- This article assumes that you already have the Azure QDK extension installed on Visual Studio Code. If you are installing for the first time, then please refer to the installation guide.
Update the Visual Studio Code extension
By default, Visual Studio Code updates extensions automatically. After any updates, you are prompted to reload VS Code. If you prefer to disable auto-updates and update extensions manually, see Extension auto-update in the VS Code documentation.
Update the Azure Quantum Python packages
Important
If you are updating from a previous Qiskit environment, see Update the azure-quantum package with Qiskit support in a virtual Python environment (recommended).
Update to the latest
qsharp
andazure-quantum
Python packages by using the package installer for Python (pip).pip install --upgrade qsharp>=1.0
pip install --upgrade azure-quantum
Update the azure-quantum package with Qiskit support in a virtual Python environment (recommended)
The azure-quantum Python package includes optional support for creating and submitting Qiskit circuits to Azure Quantum. When you install the azure-quantum package with Qiskit support, it installs the latest version of Qiskit, which may cause issues with an existing Qiskit environment. To ensure a stable development environment, we recommend creating a virtual Python environment and installing azure-quantum there.
To create a virtual Python environment and install azure-quantum with Qiskit support:
Create a local folder, for example ~/qiskit10-env.
Run
venv
with the path to the folderpython3 -m venv ~/qiskit10-env
Activate the environment.
~/qiskit10-env/bin/activate
Run
pip list
and you can see that only the core packages are installed in the new environment.To install the azure-quantum package, run
pip install azure-quantum[qiskit]
Install any other packages that you used in your previous environment as needed. You can run
pip list
in each environment to compare packages and versions.
Note
See Qiskit 1.0 packaging changes for more information on package compatibility.
Note
You can also open your virtual environment in VS Code. From the View menu, select Command Palette > Python: Create Environment > venv. In the lower right, select Open Folder... and select the environment folder you created earlier. For more information on using environments in VS Code, see Python environments in VS Code.
Update the azure-quantum package with Qiskit support in the current environment
You can also update the azure-quantum package with Qiskit support without using a virtual environment. However, updates to the qiskit packages in an existing environment may cause dependency conflicts with other packages. See Qiskit 1.0 packaging changes for more information on package compatibility.
To update the azure-quantum package:
Uninstall the existing azure-quantum and qiskit packages:
pip uninstall -y azure-quantum qiskit qiskit-terra qiskit-qir
Install azure-quantum using the optional [qiskit] parameter:
pip install azure-quantum[qiskit]
Update the Azure CLI quantum extension
Update or install the latest Azure CLI quantum
extension.
Open a Windows command prompt.
From the command prompt, run
az extension add \ --upgrade \ --name quantum