1

EDIT: the issue is resolved (kinda). Check GitHub discussion. It turns out that there are possibly two problematic factors. First (my case), the newest version of Jupyter extension. When I switched back to 2025.8.0 I could finally get back to work... Second factor (case of zoczkos) is ipykernel version. Today on Sep 13th a new version 7.0.0 was released. It can cause problems. 6.30.1 works fine.

EDIT 2: with new updates of both Jupyter VSCode extension to 2025.9.1 and ipykernel to 7.0.1, I can now confirm that all the problems below are fully solved on VSCode 1.105.0.


I encountered this strange and the most frustrating issue as below. I am aware that I can receive thumbs down but at the same time I'm equally desperate because I'm trying not to lost my project. Honestly I don't know what to do...

On Friday 10th I left my computer with a couple of windows open - including VSCode with a bunch of Python/Jupyter scripts open. Everything worked completely fine. When I came back home today, I discovered that the computer probably restarted itself or simply I forgot to close/sleep it properly and the battery got empty.

Since restart, I absolutely can't run any Jupyter Notebook using .venv created by VSCode.

The most interesting part of that problem is that on the glance everything is correct - pip and all Jupyter libraries are installed under site-packages, namely notebook, ipykernel, IPython and ipywidgets. However, upon run I always get Running cells with '.venv (Python 3.12.2)' requires the ipykernel and pip package.. Next, when I click Install, I get There is no Pip installer available in the selected environment..

When I try to run VSCode command Jupyter: Select Interpreter to Start Jupyter Server and select .venv, I always get Running cells with '.venv (Python 3.12.2)' requires the pip, jupyter and notebook package.. Again, I can't install any package through Jupyter extensions because, according to them, pip is not installed at all. Other ways of assigning Jupyter to .venv also fail (e.g. Python: Select Interpreter).

That's total nonsense - the Jupyter kernel is detected by Jupyter and stored in .venv. Without pip I wouldn't be able to install any library manually which I tried multiple times - especially for ipykernel. I wouldn't even be able to create .venv with requirements.txt that I have. Next, Jupyter output produces this message:

Running cells with '.venv (Python 3.12.2)' requires the ipykernel package.
Install 'ipykernel' into the Python environment. 
Command: '"d:/path/.venv/Scripts/python.exe" -m pip install ipykernel -U --force-reinstall'

I even tried copying this exact command and running from .venv terminal. It finishes without any problems but still Jupyter does not recognize any needed packages.

I tried the solutions below:

  1. https://stackoverflow.com/a/55631501/11485896 - .venv already selected. No effect.
  2. VSCode reinstall with .vscode folder deleted. Done, the problem persists.
  3. Python 3.12.2 reinstall. Same.
  4. .venv recreation with requirements.txt. Nope.
  5. Settings change (still failed):
    "python.defaultInterpreterPath": ".\\.venv\\Scripts\\python.exe",
    "jupyter.allowUnauthorizedRemoteConnection": true,
    "python.terminal.activateEnvironment": true,
    "python.venvPath": ".\\.venv\\Scripts\\python.exe",
    "python.venvFolders": ["venv", ".venv"]
  1. py -m ipykernel install --user --name=.venv ran from .venv terminal created virutal environment in C:\Users\user\AppData\Roaming\jupyter\kernels\.venv. Didn't help too.

Proof that Jupyter sees kernels (jupyter kernelspec list):

Available kernels:
  python3    d:\path\.venv\share\jupyter\kernels\python3
  .venv      C:\Users\user\AppData\Roaming\jupyter\kernels\.venv

Jupyter debug's output:

>jupyter --version
Selected Jupyter core packages...
IPython          : 9.6.0
ipykernel        : 6.30.1
ipywidgets       : 8.1.7
jupyter_client   : 8.6.3
jupyter_core     : 5.8.1
jupyter_server   : 2.17.0
jupyterlab       : 4.4.9
nbclient         : 0.10.2
nbconvert        : 7.16.6
nbformat         : 5.10.4
notebook         : 7.4.7
qtconsole        : not installed
traitlets        : 5.14.3
>jupyter --paths --debug
JUPYTER_PLATFORM_DIRS is set to a false value, or is not set, so we use hardcoded legacy paths for platform-specific directories
JUPYTER_PREFER_ENV_PATH is set to a true value, or JUPYTER_PREFER_ENV_PATH is not set and we detected a virtual environment, making the environment-level path preferred over the user-level path for data and config
JUPYTER_NO_CONFIG is not set, so we use the full path list for config
JUPYTER_CONFIG_PATH is not set, so we do not prepend anything to the config paths
JUPYTER_CONFIG_DIR is not set, so we use the default user-level config directory
Python's site.ENABLE_USER_SITE is not True, so we do not add the Python site user directory 'C:\Users\user\AppData\Roaming\Python'
JUPYTER_PATH is not set, so we do not prepend anything to the data paths
JUPYTER_DATA_DIR is not set, so we use the default user-level data directory
JUPYTER_RUNTIME_DIR is not set, so we use the default runtime directory

config:
    d:\path\.venv\etc\jupyter
    C:\Users\user\.jupyter
data:
    d:\path\.venv\share\jupyter
    C:\Users\user\AppData\Roaming\jupyter
runtime:
    C:\Users\user\AppData\Roaming\jupyter\runtime

Any ideas? Please help. I'm very frustrated. Note: I'm not experienced user in Jupyter Notebooks.

Python: 3.12.2 VSCode: 1.105.0 Jupyter extension: 2025.9.0 Windows: 11 24H2 26100.6725

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.