I’m encountering a very weird issue, as the following picture shows. I can select my IPython kernel from a virtual environment but it displays as micromamba (Python 3.1.-1)
while it should be 3.12.0. This makes other extensions (e.g. Pylance) disabled since it’s an unsupported Python environment.
What can I do?
Update: Here is the kernel options and the result of running python_version()
, I really doubt it’s a matter of displaying.
2
Answers
It seems like you are not actually running on Python 3.12 here.
By using the exclamation mark command
! python --version
you are asking the shell to tell you its python version. This is not the same as the version of the Jupyter Kernel.You can figure out which Python version is running in your notebook like this
You can change the Kernel in use by clicking on the version name and number in the notebook
micromamba (Python 3.1.-1)
or in VS Code by typingCtrl
+Shift
+P
>Notebook: Select Notebook Kernel
.If you do not have the version installed that you would like, install the desired ipykernel.
Which will then use the Python version from the myenv environment.
I am using Miniforge (mamba), and I had the same issue. Apparently there is some problem with the newer versions. Please rollback your Jupyter Extension to
2024.1.0
for the bug to vanish. See.Here is how you would change your extension version:
Jupyter (ms-toolsai.jupyter)
.Uninstall
, it will show an option,Install Another Version...
.2024.1.0
.a screenshot of the extensions page