-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The virtual environment is not activated after restarting the workspace. #24558
Comments
@recsater Do you have these two settings enabled? |
Actually, I have already tried the same test multiple times with those options set to true. |
I'm having the same issue since the last VSCode update. The two settings are enabled, the virtual environment is active, but any new terminal I open, unless I activate the virtual environment manually, it runs on global environment. VSCode
-----------------------
Version: 1.96.0 (user setup)
Commit: 138f619c86f1199955d53b4166bef66ef252935c
Date: 2024-12-11T02:29:09.626Z
Electron: 32.2.6
ElectronBuildId: 10629634
Chromium: 128.0.6613.186
Node.js: 20.18.1
V8: 12.8.374.38-electron.0
OS: Windows_NT x64 10.0.22631 OS
-----------------------
Edition Windows 11 Pro
Version 23H2
Installed on 10/03/2024
OS build 22631.4460
Experience Windows Feature Experience Pack 1000.22700.1047.0 Python Extension
-----------------------
Name: Python
Id: ms-python.python
Version: 2024.22.0
Publisher: Microsoft |
Please share your logs from Output > Python and Output > Python Locator. Also, provide the path to the virtual environment you are expecting it to activate. |
2024-12-16 00:28:25.666 [info] Experiment 'pythonTerminalEnvVarActivation' is inactive
2024-12-16 00:28:25.666 [info] Experiment 'pythonRecommendTensorboardExt' is active
2024-12-16 00:28:25.666 [info] Experiment 'pythonTestAdapter' is active
2024-12-16 00:28:25.666 [info] Native locator: Refresh started
2024-12-16 00:28:25.666 [info] Native locator: Refresh started
2024-12-16 00:28:25.687 [info] Native locator: Refresh started
2024-12-16 00:28:25.694 [info] > pyenv which python
2024-12-16 00:28:25.694 [info] cwd: .
2024-12-16 00:28:25.702 [info] Native locator: Refresh finished in 158 ms
2024-12-16 00:28:25.704 [info] Python interpreter path: ./.venv/bin/python
2024-12-16 00:28:26.903 [info] Starting Pylance language server.
2024-12-16 00:28:53.975 [info] Native locator: Refresh started
2024-12-16 00:28:53.999 [info] Native locator: Refresh finished in 24 ms
2024-12-16 00:28:53.999 [info] Discover tests for workspace name: xeye - uri: /root/multipleye/xeye
2024-12-16 00:29:43.969 [info] Native locator: Refresh started
2024-12-16 00:29:43.996 [info] Native locator: Refresh finished in 26 ms
2024-12-16 00:30:07.560 [info] Native locator: Refresh started
2024-12-16 00:30:07.585 [info] Native locator: Refresh finished in 25 ms
2024-12-16 00:30:07.585 [info] Discover tests for workspace name: xeye - uri: /root/multipleye/xeye
2024-12-16 00:30:21.045 [info] Discover tests for workspace name: xeye - uri: /root/multipleye/xeye
2024-12-16 00:30:21.045 [info] Python interpreter path: ./xeye-python/.venv/bin/python
2024-12-16 00:30:26.368 [info] Send text to terminal: source /root/multipleye/xeye/xeye-python/.venv/bin/activate
After reloading window, no Python output. |
I have the same issue. Repros every time. |
Same here. Tried with those options off and on. Same workspace that worked ~3 weeks ago. Haven't touched anything on my local setup except for updating VSCode. |
Type: Bug
Behaviour
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 theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)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.languageServer
setting: DefaultUser Settings
Installed Extensions
System Info
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
A/B Experiments
The text was updated successfully, but these errors were encountered: