Skip to content

Selected pipenv virtualenv is written to python.pythonPath #15634

Closed
@Urkallinger

Description

@Urkallinger

Since some time (I can't say when exactly) the virutalenv is not recognized in my project. I open the project folder with vs code and as soon as the python extension is loaded, the system wide installation of python is recognized as interpreter, although there is a pipfile in my project folder.

Environment data

  • VS Code version: 1.54.1
  • Extension version (available under the Extensions sidebar): v2021.2.636928669
  • OS and version: Windows 10, 20H2
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7.3
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): pipenv virutalenv
  • Value of the python.languageServer setting: Pylance

Expected behaviour

the virutalenv is recognized and I don't have to set the "python.pythonPath" setting explicitly.

Actual behaviour

The system-wide Python installation is selected as interpreter.
When I change the interpreter to the pipenv virtualenv, the absolute path is entered into my settings.json.
This is problematic because the virutalenv is in my user directory and so the path is not correct for all developers involved.

Details

The corresponding virtualenv is marked as "(cached)" in the interpreter selection.

I already tried the following commands:

  • Python: Clear Workspace Interpreter Settings
  • Python: Reset Stored Info for Untrusted Interpreters

both had no effect.

i also reinstalled vs code and deleted the folders in %appdata%, but still the virutalenv was not detected.

Metadata

Metadata

Assignees

Labels

area-environmentsFeatures relating to handling interpreter environmentsbugIssue identified by VS Code Team member as probable buginfo-neededIssue requires more information from poster

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions