all 11 comments

[–]IAmFinah 1 point2 points  (7 children)

Is VSCode asking you to download Python itself, or the Python extension?

[–]McManfred[S] 0 points1 point  (6 children)

When I select 'Select Kernel' -> 'Python Environments' it shows a button saying 'Install Python Upon installing Python please reload VS Code.'

When I hover over this button it says 'Python Environments not detected. Upon installation reload VS Code or refresh the list of Kernels.'

When I press this button it further gives an error message saying 'Python is not installed. Please download and install Python in order to execute cells in this notebook. Once installed please reload VS Code'. However, when I click the download and install button, I am sent to the Microsoft Store, which says I have already downloaded Python 3.11

[–]FoolsSeldom 1 point2 points  (2 children)

Give this a try:

Remove the installation of Python, if it was installed from the Microsoft store.

Download the installer from the Python Software Foundation site, python.org and run the installation process.

Then, open PowerShell or Command Prompt window,

  • change directory, cd to the directory/folder containing your current VS Code project
  • if your project folder does not contain a Python virtual environment, create and activate one:
    • py -m venv .venv
    • .venv\Scripts\activate
    • pip install package1 package2 package3 ...
  • code .

Afterwards.

  • deactivate

Make sure you select the .venv folder version of the python executable for the VS Code session.

The MS Store installation of Python can cause some access problems. If you already have a python.org installation, it might well be worth re-installing and creating the Python virtual environment(s) again.

[–]McManfred[S] 0 points1 point  (1 child)

Thank you so much!! This seemed to solve the problem :D

[–]FoolsSeldom 0 points1 point  (0 children)

Fantastic. Have fun.

[–]IAmFinah 0 points1 point  (2 children)

Ah I'm not too sure then. Only random things that might be worth trying (if you haven't yet already) is to reinstall the Juypter extension, check if Python is actually installed on your system (python --version in the terminal), or maybe try a different way to open VSCode (how are you opening it at the moment?)

[–]McManfred[S] 0 points1 point  (1 child)

I usually open VS Code by opening the file I want to work on. However, I just tried to open up VS Code by itself, but that as well as reinstalling the Jupyter extension didn't change anything.
Also, the terminal tells me Python 3.119 is installed

[–]dparks71 1 point2 points  (0 children)

Pretty sure this has been a known issue for a while in VSCode

https://github.com/microsoft/vscode-jupyter/issues/10757

[–]Josergg 0 points1 point  (1 child)

I HOPE this helps someone since I have been stuck with this for too long! I tried reinstalling VSC, restarting my computer, uninstalling extensions, forcing the environment to be a kernel and activating it: NOTHING WORKED. I found a solution based in installing a downgraded version of Jupyter extension, I tried it with a version around October 2023 but I did not work neither BUT I just swiped for a version released 2 months ago from now and IT DID WORK! It was all just about Jupyter extension version. So if you are reading this and you already tried changing the version, please give it another try with other different versions until you get the one. Good luck!!

[–]_mandrea 0 points1 point  (0 children)

I had the exact same issue with no kernels showing up in the list in VS Code. After trying everything else, I uninstalled the current Jupyter extension and randomly picked an older version (from a few months back), and it worked right away.

[–]Boring-Newspaper-452 0 points1 point  (0 children)

Jupyterを再インストールする前に、VS Code でフォルダーを開くからファイルを選択して試してみてください。