Skip to content
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

python virtual environment not work correctly #235061

Closed
SethWen opened this issue Dec 3, 2024 · 3 comments
Closed

python virtual environment not work correctly #235061

SethWen opened this issue Dec 3, 2024 · 3 comments
Assignees

Comments

@SethWen
Copy link

SethWen commented Dec 3, 2024

Type: Bug

When create python virtual environment at one project root directory using conda, the terminal can not activate the env automatically, and the test extension can not work correctly.

Steps to Reproduce:

  1. cd you_project
  2. conda create -p venv pytest now we create a conda virtual environment at ./venv

After that the terminal cannot automatically activate as before, and the test extension can not work.

It looks like somewhere can not correctly use the venv because I create it using conda create -p ....

The following is some logs after clicking refreshing tests button.

2024-12-03 14:28:15.676 [info] Native locator: Refresh started
2024-12-03 14:28:15.709 [info] Conda environment manager found at: /home/shawn/opt/miniconda3/bin/conda
2024-12-03 14:28:15.740 [info] Native locator: Refresh finished in 65 ms
2024-12-03 14:29:05.996 [info] Discover tests for workspace name: rum-assistant-python - uri: /home/shawn/workspace/rum-assistant-python
2024-12-03 14:29:05.996 [info] Running discovery for pytest using the new test adapter.
2024-12-03 14:29:05.996 [info] Python interpreter path: ./venv/bin/python
2024-12-03 14:29:05.999 [error] Test discovery already in progress, not starting a new one.
2024-12-03 14:29:05.999 [info] > conda run -n venv --no-capture-output python ~/.vscode-server/extensions/ms-python.python-2024.21.2024112901-linux-x64/python_files/get_output_via_markers.py ~/.vscode-server/extensions/ms-python.python-2024.21.2024112901-linux-x64/python_files/printEnvVariables.py
2024-12-03 14:29:05.999 [info] shell: bash
2024-12-03 14:29:06.279 [error] getActivatedEnvironmentVariables [Error: Command failed: conda run -n venv --no-capture-output python /home/shawn/.vscode-server/extensions/ms-python.python-2024.21.2024112901-linux-x64/python_files/get_output_via_markers.py /home/shawn/.vscode-server/extensions/ms-python.python-2024.21.2024112901-linux-x64/python_files/printEnvVariables.py

EnvironmentLocationNotFound: Not a conda environment: /home/shawn/opt/miniconda3/envs/venv


	at genericNodeError (node:internal/errors:984:15)
	at wrappedFn (node:internal/errors:538:14)
	at ChildProcess.exithandler (node:child_process:422:12)
	at ChildProcess.emit (node:events:531:35)
	at maybeClose (node:internal/child_process:1105:16)
	at ChildProcess._handle.onexit (node:internal/child_process:305:5)] {
  code: 1,
  killed: false,
  signal: null,
  cmd: 'conda run -n venv --no-capture-output python /home/shawn/.vscode-server/extensions/ms-python.python-2024.21.2024112901-linux-x64/python_files/get_output_via_markers.py /hom

VS Code version: Code 1.95.3 (f1a4fb1, 2024-11-13T14:50:04.152Z)
OS version: Windows_NT x64 10.0.22631
Modes:
Remote OS version: Linux x64 5.15.0-124-generic

System Info
Item Value
CPUs Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz (8 x 2112)
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: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 15.80GB (6.01GB free)
Process Argv --crash-reporter-id 7cc00638-f229-473c-9eb9-a4c31d391ccf
Screen Reader no
VM 0%
Item Value
Remote SSH: dev.founder
OS Linux x64 5.15.0-124-generic
CPUs Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz (12 x 800)
Memory (System) 15.41GB (13.27GB free)
VM 0%
Extensions (35)
Extension Author (truncated) Version
vscode-sql-formatter adp 1.4.4
biome bio 2.3.0
ruff cha 2024.56.0
vscode-eslint dba 3.0.10
dependi fil 0.7.13
vscode-jest-runner fir 0.4.74
Fitten-Code Fit 0.10.104
vscode-mysql for 0.5.0
git-graph mhu 1.30.0
debugpy ms- 2024.12.0
python ms- 2024.21.2024112901
vscode-pylance ms- 2024.11.3
cmake-tools ms- 1.19.52
cpptools ms- 1.22.11
cpptools-extension-pack ms- 1.3.0
sqlite-viewer qwt 0.9.5
rust-analyzer rus 0.3.2204
even-better-toml tam 0.19.2
cmake twx 0.0.17
vscode-lldb vad 1.11.1
es7-react-js-snippets dsz 4.4.3
vscode-jetbrains-keybindings isu 0.1.9
better-cpp-syntax jef 1.27.1
intellij-idea-keybindings k-- 1.7.3
dotenv mik 1.0.1
remote-containers ms- 0.388.0
remote-ssh ms- 0.115.1
remote-ssh-edit ms- 0.87.0
remote-wsl ms- 0.88.5
remote-explorer ms- 0.4.3
material-icon-theme PKi 5.14.1
sqlite-viewer qwt 0.9.5
glassit s-n 0.2.6
svg-preview Sim 2.8.3
vscode-todo-highlight way 1.0.5

(3 theme extensions excluded)

A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492cf:30256860
pythonvspyt551:31179978
vscod805cf:30301675
binariesv615:30325510
vsaa593:30376534
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyonecf:30548226
962ge761:30959799
pythonnoceb:30805159
asynctok:30898717
pythonmypyd1:30879173
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
dvdeprecation:31068756
dwnewjupytercf:31046870
nativerepl2:31139839
pythonrstrctxt:31112756
nativeloc1:31192215
cf971741:31144450
iacca1:31171482
notype1cf:31157160
5fd0e150:31155592
dwcopilot:31170013
stablechunks:31184530

@wei-lingfeng
Copy link

Same problem here on Windows 11, as mentioned in issue 234035

@SethWen
Copy link
Author

SethWen commented Dec 5, 2024

Yes. It is very buggy. When writing python using vscode, it even make many other extensions not work.
For example:

  • git keep tracing somthing
    Image
  • FittenCode(Extension ID: FittenTech.Fitten-Code) can not response.
    But when writing typescript using vscode, the above works correctly.

@karthiknadig
Copy link
Member

Duplicate of microsoft/vscode-python#24472

@karthiknadig karthiknadig closed this as not planned Won't fix, can't repro, duplicate, stale Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants