skip to Main Content

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?

screenshot showing the running kernel

Update: Here is the kernel options and the result of running python_version(), I really doubt it’s a matter of displaying.
enter image description here

2

Answers


  1. 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

    from platform import python_version
    
    print(python_version())
    

    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 typing Ctrl + Shift + P > Notebook: Select Notebook Kernel.

    If you do not have the version installed that you would like, install the desired ipykernel.

    source activate myenv
    python -m ipykernel install --user --name myenv --display-name "Python (myenv)"
    

    Which will then use the Python version from the myenv environment.

    Login or Signup to reply.
  2. 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:

    1. Go to Extensions panel, select Jupyter (ms-toolsai.jupyter).
    2. Click on the drop-down menu near Uninstall, it will show an option, Install Another Version....
    3. Please select 2024.1.0.
    4. Restart extensions!

    a screenshot of the extensions page

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search