Skip to content

The virtual environment is not activated after restarting the workspace. #24558

@recsater

Description

@recsater

Type: Bug

Behaviour

Image

Steps to reproduce:

"The video can be summarized as follows:

By default, the virtual environment is not activated in a new terminal unless the interpreter is selected through the command palette.
Even if the interpreter is selected, the virtual environment is not activated in a new terminal after restarting the window.
After restarting the window, entering and exiting the Python extension tab will activate the virtual environment in a new terminal.
However, the virtual environment will still not activate after restarting the window unless the Python extension tab is accessed."

Diagnostic data

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

XXX

Extension version: 2024.20.0
VS Code version: Code 1.95.3 (f1a4fb101478ce6ec82fe9627c43efbf9e98c813, 2024-11-13T14:50:04.152Z)
OS version: Linux x64 6.8.0-49-generic
Modes:
Remote OS version: Linux x64 6.8.0-49-generic

  • Python version (& distribution if applicable, e.g. Anaconda): 3.13.0
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Venv
  • Value of the python.languageServer setting: Default
User Settings


languageServer: "Pylance"

experiments
• optOutFrom: ["pythonTerminalEnvVarActivation"]

Installed Extensions
Extension Name Extension Id Version
JavaScript Debugger ms-vscode.js-debug 1.95.3
Pylance ms-python.vscode-pylance 2024.12.1
Python ms-python.python 2024.20.0
Python Debugger ms-python.debugpy 2024.12.0
Python Environment Manager donjayamanne.python-environment-manager 1.2.4
Table Visualizer for JavaScript Profiles ms-vscode.vscode-js-profile-table 1.0.10
System Info
Item Value
CPUs Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz (16 x 4600)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
webnn: disabled_off
Load (avg) 1, 1, 1
Memory (System) 62.73GB (29.26GB free)
Process Argv . --crash-reporter-id 3b34a8a1-42be-48ca-bf66-b7198c02f9c8
Screen Reader no
VM 0%
DESKTOP_SESSION ubuntu
XDG_CURRENT_DESKTOP Unity
XDG_SESSION_DESKTOP ubuntu
XDG_SESSION_TYPE x11
Item Value
Remote Container xeye0324/ros:atd-34-plan_linux_amd64 (atd-34-plan_linux_amd64)
OS Linux x64 6.8.0-49-generic
CPUs Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz (16 x 4599)
Memory (System) 62.73GB (29.26GB free)
VM 0%
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805:30301674
binariesv615:30325510
vsaa593:30376534
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
vscrpc:30673769
a9j8j154:30646983
962ge761:30959799
pythonnoceb:30805159
pythonmypyd1:30879173
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
dvdeprecation:31068756
dwnewjupytercf:31046870
newcmakeconfigv2:31071590
nativerepl1:31139838
pythonrstrctxt:31112756
nativeloc1:31192215
cf971741:31144450
iacca1:31171482
notype1cf:31157160
5fd0e150:31155592
dwcopilot:31170013
stablechunks:31184530

![Image](https://github.com/user-attachments/assets/9ec38505-aad1-4162-9520-86fb5d37f6c8)

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugtriage-neededNeeds assignment to the proper sub-team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions