How do I find out what version of qiskit I am running?
7 Answers
You can use the command:
qiskit.__qiskit_version__
Current qiskit version is 0.23.4 as you can see below:
{'qiskit-terra': '0.16.3',
'qiskit-aer': '0.7.3',
'qiskit-ignis': '0.5.1',
'qiskit-ibmq-provider': '0.11.1',
'qiskit-aqua': '0.8.1',
'qiskit': '0.23.4'}
If you want to see the changes in different versions then you can check the Release Note posted by the IBM team when there is an update to the system.
-
$\begingroup$ In the windows powershell I tried qiskit.__qiskit_version__ on every level of directory from c: through c:\users\lewis\qiskit-terra\qiskit. Every time I get: $\endgroup$ Commented Jan 29, 2021 at 16:40
Edit
Since Qiskit 1.x this changed, I'll change my answer accordingly.
Now, in order to see your qiskit version you can do
import qiskit
print(qiskit.version.get_version_info())
and you'll get back the qiskit version.
Also fyi, here is the Qiskit documentation and the latest release notes id you're interested in checking further!
Initial answer
Here is the code you need to run to know which version you have:
import qiskit.tools.jupyter
%qiskit_version_table
%qiskit_copyright
If you want to check the latest version, you can go read the release notes :)
-
$\begingroup$ This one was very usefull, do you knowe any replacement in qiskit 1.1 era? $\endgroup$ Commented Aug 2 at 20:46
-
$\begingroup$ Hey @AdamMierzwiak thanks for commenting, I added an update so the code now works with the latest qiskit version :) $\endgroup$– LenaCommented Aug 7 at 13:10
I believe the qiskit_version command only works inside of a python virtual env with qiskit installed.
So, I recommended to install qiskit inside of a Python virtual environment for better experience and performance as suggested here and that should help with your question too.
Once a Python virtual environment is created using conda (Anaconda), install qiskit using pip install qiskit. Then import qiskit into your virtual environment and run qiskit_version
open the directory in which you want to work in the terminal and then...
conda create -n qiskit_virtualenv python=3.8
conda activate qiskit_virtualenv
pip install qiskit
import qiskit
__qiskit_version__
If you installed qiskit using pip, you could run the following on the command line:
pip show qiskit
Since Qiskit 1.0, you can do it as many other modules do: by printing __version__
.
from qiskit import __version__
print(__version__)
There was alot of change since Qiskit 1.0.0 version released. One such changes is to check the version of Qiskit used in your local machine. You can also use this command in google collab too.
The command is:
pip list | grep "qiskit"
pip list | grep "IBMQuantumExperience"
pip list | grep "qiskit-aer"
pip list | grep "qiskit-terra"
python --version
In notebook add "!" at the begining
-
$\begingroup$ seems this : ``` pip list | grep "qiskit-aer" pip list | grep "qiskit-terra" ``` will be alreaedy printed by this: ``` pip list | grep "qiskit" ``` $\endgroup$ Commented Jun 30 at 21:27