Skip to content

Virtual environment from a previous workspace activated in a new workspace that I openedΒ #23352

@qubitron

Description

@qubitron

Behaviour

The virtual environment of a previous workspace I'm using appears to have somehow been set as the defaultPythonInterpreter

Steps to reproduce:

  1. From the command line, create folder1 and inside of it a virtual environment in it.
  2. Open VS code (code .) in that folder and create a basic "helloworld.py" python script
  3. Now create folder2, and then open vs code (code .) in that folder with a basic helloworld.py

image

Diagnostic data

Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)

2024-05-06 14:23:23.876 [info] Experiment 'pythonRecommendTensorboardExt' is active
2024-05-06 14:23:23.876 [info] Experiment 'pythonREPLSmartSend' is active
2024-05-06 14:23:23.876 [info] Experiment 'pythonSurveyNotificationcf' is active
2024-05-06 14:23:23.876 [info] Experiment 'pythonTerminalEnvVarActivation' is active
2024-05-06 14:23:23.876 [info] Experiment 'pythonTestAdapter' is active
2024-05-06 14:23:23.876 [info] Default formatter is set to null for workspace c:\dev\bugbash\hubs-and-projects-bugbash
2024-05-06 14:23:23.876 [info] > hatch env show --json
2024-05-06 14:23:23.876 [info] cwd: .
2024-05-06 14:23:23.876 [info] Python interpreter path: c:\dev\promptflow\.venv\Scripts\python.exe
2024-05-06 14:23:23.911 [info] > conda info --json
2024-05-06 14:23:23.981 [info] > c:\dev\promptflow\.venv\Scripts\python.exe -I ~\.vscode\extensions\ms-python.python-2024.6.0\python_files\get_output_via_markers.py ~\.vscode\extensions\ms-python.python-2024.6.0\python_files\interpreterInfo.py
2024-05-06 14:23:24.226 [info] > pyenv which python
2024-05-06 14:23:24.226 [info] cwd: .
2024-05-06 14:23:24.370 [info] > c:/dev/promptflow/.venv/Scripts/activate.bat && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode/extensions/ms-python.python-2024.6.0/python_files/printEnvVariables.py
2024-05-06 14:23:24.370 [info] shell: commandPrompt
2024-05-06 14:23:24.743 [info] > ~\AppData\Local\Programs\Python\Python312\python.exe ~/.vscode/extensions/ms-python.python-2024.6.0/python_files/printEnvVariables.py
2024-05-06 14:23:24.743 [info] shell: commandPrompt
2024-05-06 14:23:24.851 [info] Prepending environment variable PATH in collection with c:\dev\promptflow\.venv\Scripts; {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2024-05-06 14:23:24.851 [info] Setting environment variable PROMPT in collection to (.venv) $P$G {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2024-05-06 14:23:24.851 [info] Setting environment variable VIRTUAL_ENV in collection to c:\dev\promptflow\.venv {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2024-05-06 14:23:24.851 [info] Setting environment variable VIRTUAL_ENV_PROMPT in collection to (.venv)  {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2024-05-06 14:23:24.851 [info] Setting environment variable _OLD_VIRTUAL_PROMPT in collection to $P$G {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2024-05-06 14:23:25.561 [info] Starting Pylance language server.
2024-05-06 14:33:14.732 [info] > ~\AppData\Local\Programs\Python\Python312\python.exe -I ~\.vscode\extensions\ms-python.python-2024.6.0\python_files\get_output_via_markers.py ~\.vscode\extensions\ms-python.python-2024.6.0\python_files\interpreterInfo.py
2024-05-06 14:33:42.525 [info] > .\.venv\Scripts\python.exe -I ~\.vscode\extensions\ms-python.python-2024.6.0\python_files\get_output_via_markers.py ~\.vscode\extensions\ms-python.python-2024.6.0\python_files\interpreterInfo.py
2024-05-06 14:33:49.273 [info] Discover tests for workspace name: hubs-and-projects-bugbash - uri: c:\dev\bugbash\hubs-and-projects-bugbash
2024-05-06 14:33:49.275 [info] Python interpreter path: .\.venv\Scripts\python.exe
2024-05-06 14:33:50.339 [info] Prepending environment variable PATH in collection with c:\dev\bugbash\hubs-and-projects-bugbash\.venv\Scripts; {"applyAtShellIntegration":true,"applyAtProcessCreation":true}
2024-05-06 15:14:15.564 [info] Discover tests for workspace name: hubs-and-projects-bugbash - uri: c:\dev\bugbash\hubs-and-projects-bugbash\create_hub_and_project.py
2024-05-06 15:27:52.650 [info] Discover tests for workspace name: hubs-and-projects-bugbash - uri: c:\dev\bugbash\hubs-and-projects-bugbash\create_hub_and_project.py
2024-05-06 15:30:58.959 [info] Discover tests for workspace name: hubs-and-projects-bugbash - uri: c:\dev\bugbash\hubs-and-projects-bugbash\create_hub_and_project.py
2024-05-06 15:34:36.006 [info] Discover tests for workspace name: hubs-and-projects-bugbash - uri: c:\dev\bugbash\hubs-and-projects-bugbash\create_hub_and_project.py
2024-05-06 15:37:02.606 [info] Discover tests for workspace name: hubs-and-projects-bugbash - uri: c:\dev\bugbash\hubs-and-projects-bugbash\create_hub_and_project.py
2024-05-06 15:51:31.032 [info] Discover tests for workspace name: hubs-and-projects-bugbash - uri: c:\dev\bugbash\hubs-and-projects-bugbash\example-hub-and-project-manipulation.py
2024-05-06 15:53:39.131 [info] Discover tests for workspace name: hubs-and-projects-bugbash - uri: c:\dev\bugbash\hubs-and-projects-bugbash\create_hub_and_project.py
2024-05-06 15:53:53.140 [info] Discover tests for workspace name: hubs-and-projects-bugbash - uri: c:\dev\bugbash\hubs-and-projects-bugbash\create_hub_and_project.py
2024-05-06 16:03:30.288 [info] > .\.venv\Scripts\python.exe -I ~\.vscode\extensions\ms-python.python-2024.6.0\python_files\get_output_via_markers.py ~\.vscode\extensions\ms-python.python-2024.6.0\python_files\interpreterInfo.py
2024-05-06 16:03:31.097 [info] > .\.venv\Scripts\python.exe -I ~\.vscode\extensions\ms-python.python-2024.6.0\python_files\get_output_via_markers.py ~\.vscode\extensions\ms-python.python-2024.6.0\python_files\interpreterInfo.py

Metadata

Metadata

Assignees

Labels

area-environmentsFeatures relating to handling interpreter environmentsbugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions