[Python] Why is VSCode prepending a non-activated venv to my $PATH when I connect to a Linux...

Discussão em 'Python' iniciado por Stack, Março 11, 2025.

  1. Stack

    Stack Membro Participativo

    I use VSCode for Windows to develop python on a remote Linux server. At some point in the last couple weeks, I must have disconnected unexpectedly while my virtual environment /home/username/ml-proto-env was active. Now, whenever I connect to the remote, it appends the following four entries to the beginning of my $PATH environment variable:

    /home/username/.vscode-server/extensions/ms-python.python-2025.2.0-linux-x64/python_files/deactivate/bash:/home/username/ml-proto-env/bin:/home/username/.vscode-server/extensions/ms-python.python-2025.2.0-linux-x64/python_files/deactivate/bash:/home/username/ml-proto-env/bin:

    I opened the JSON settings and set terminal.integrated.env.linux {"PATH"} to what I'd like it to be, but it still prepends the above paths. It's also not auto-activating the venv, because deactivate is undefined and none of the temporary venv-related environment variables are set. Why is it doing this, and how can I get it to stop? It's really annoying having to prune them out of my PATH before I can use any Python.

    Continue reading...

Compartilhe esta Página