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

Terminals do not autoactivate when using workspace .conda environment #24640

Open
louis-br opened this issue Dec 18, 2024 · 2 comments
Open

Terminals do not autoactivate when using workspace .conda environment #24640

louis-br opened this issue Dec 18, 2024 · 2 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team

Comments

@louis-br
Copy link

Type: Bug

Behaviour

An error occurs when selecting the python interpreter for a conda enviroment in the current workspace (.conda). It prevents terminals from autoactivating, terminals will then open with the base environment. Possibly due to different use of local vs global paths.

This issue does not occur when using a named environment which is placed in C:\Users\User.conda\envs. However, ".conda" environments are not placed there! See logs below.

Steps to reproduce:

  1. Create a new conda environment in the current workspace (.conda)
  2. Wait until the error appears in the Python Output panel.

Diagnostic data

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

2024-12-18 16:27:33.861 [info] > F:\anaconda3\condabin\conda.bat info --json
2024-12-18 16:27:35.542 [error] getActivatedEnvironmentVariables Error: Command failed: F:\anaconda3\Scripts\conda.exe run -n .conda --no-capture-output python c:\Users\User\.vscode\extensions\ms-python.python-2024.22.0-win32-x64\python_files\get_output_via_markers.py c:/Users/User/.vscode/extensions/ms-python.python-2024.22.0-win32-x64/python_files/printEnvVariables.py

EnvironmentLocationNotFound: Not a conda environment: C:\Users\User\.conda\envs\.conda


    at genericNodeError (node:internal/errors:984:15)
    at wrappedFn (node:internal/errors:538:14)
    at ChildProcess.exithandler (node:child_process:423:12)
    at ChildProcess.emit (node:events:530:35)
    at maybeClose (node:internal/child_process:1104:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5) {
  code: 1,
  killed: false,
  signal: null,
  cmd: 'F:\\anaconda3\\Scripts\\conda.exe run -n .conda --no-capture-output python c:\\Users\\User\\.vscode\\extensions\\ms-python.python-2024.22.0-win32-x64\\python_files\\get_output_via_markers.py c:/Users/User/.vscode/extensions/ms-python.python-2024.22.0-win32-x64/python_files/printEnvVariables.py'
}
2024-12-18 16:27:36.523 [error] getActivatedEnvironmentVariables Error: Command failed: F:\anaconda3\Scripts\conda.exe run -n .conda --no-capture-output python c:\Users\User\.vscode\extensions\ms-python.python-2024.22.0-win32-x64\python_files\get_output_via_markers.py c:/Users/User/.vscode/extensions/ms-python.python-2024.22.0-win32-x64/python_files/printEnvVariables.py

EnvironmentLocationNotFound: Not a conda environment: C:\Users\User\.conda\envs\.conda


    at genericNodeError (node:internal/errors:984:15)
    at wrappedFn (node:internal/errors:538:14)
    at ChildProcess.exithandler (node:child_process:423:12)
    at ChildProcess.emit (node:events:530:35)
    at maybeClose (node:internal/child_process:1104:16)
    at Socket.<anonymous> (node:internal/child_process:456:11)
    at Socket.emit (node:events:518:28)
    at Pipe.<anonymous> (node:net:343:12) {
  code: 1,
  killed: false,
  signal: null,
  cmd: 'F:\\anaconda3\\Scripts\\conda.exe run -n .conda --no-capture-output python c:\\Users\\User\\.vscode\\extensions\\ms-python.python-2024.22.0-win32-x64\\python_files\\get_output_via_markers.py c:/Users/User/.vscode/extensions/ms-python.python-2024.22.0-win32-x64/python_files/printEnvVariables.py'
}

Extension version: 2024.22.0
VS Code version: Code 1.96.1 (42b266171e51a016313f47d0c48aca9295b9cbb2, 2024-12-17T17:50:05.206Z)
OS version: Windows_NT x64 10.0.26100
Modes:

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


condaPath: "<placeholder>"

languageServer: "Pylance"

Installed Extensions
Extension Name Extension Id Version
autoDocstring - Python Docstring Generator njpwerner.autodocstring 0.6.1
Black Formatter ms-python.black-formatter 2024.5.13171011
Continue - Codestral, Claude, and more Continue.continue 0.8.65
Dev Containers ms-vscode-remote.remote-containers 0.395.0
Docker ms-azuretools.vscode-docker 1.29.3
Even Better TOML tamasfe.even-better-toml 0.19.2
GitHub Copilot GitHub.copilot 1.253.0
GitHub Copilot Chat GitHub.copilot-chat 0.23.2
JavaScript Debugger ms-vscode.js-debug 1.96.0
JavaScript Debugger Companion Extension ms-vscode.js-debug-companion 1.1.3
Jupyter ms-toolsai.jupyter 2024.11.0
Jupyter Cell Tags ms-toolsai.vscode-jupyter-cell-tags 0.1.9
Jupyter Keymap ms-toolsai.jupyter-keymap 1.1.2
Jupyter Notebook Renderers ms-toolsai.jupyter-renderers 1.0.21
Jupyter Slide Show ms-toolsai.vscode-jupyter-slideshow 0.1.6
Live Share ms-vsliveshare.vsliveshare 1.0.5941
Pylance ms-python.vscode-pylance 2024.12.100
Python ms-python.python 2024.22.0
Python Environment Manager donjayamanne.python-environment-manager 1.2.4
Remote - SSH ms-vscode-remote.remote-ssh 0.116.1
Remote - SSH: Editing Configuration Files ms-vscode-remote.remote-ssh-edit 0.87.0
Remote - Tunnels ms-vscode.remote-server 1.5.2
Remote Development ms-vscode-remote.vscode-remote-extensionpack 0.26.0
Remote Explorer ms-vscode.remote-explorer 0.4.3
Ruff charliermarsh.ruff 2024.56.0
Table Visualizer for JavaScript Profiles ms-vscode.vscode-js-profile-table 1.0.10
WSL ms-vscode-remote.remote-wsl 0.88.5
System Info
Item Value
CPUs AMD Ryzen 7 5800HS with Radeon Graphics (16 x 3194)
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) 39.41GB (20.42GB free)
Process Argv F:\WindowsProjects\2024\UT\02\ciencia-dados\Atividades\Atividade05_apriori --crash-reporter-id 23fab31b-0e2a-49eb-b95c-9b258ceaab53
Screen Reader no
VM 25%
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805:30301674
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:31024239
vscaat:30438848
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythonnoceb:30805159
pythonmypyd1:30879173
2e7ec940:31000449
pythontbext0:30879054
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
dvdeprecation:31068756
dwnewjupyter:31046869
newcmakeconfigv2:31071590
nativerepl1:31139838
pythonrstrctxt:31112756
nativeloc1:31192215
cf971741:31144450
iacca1:31171482
notype1:31157159
5fd0e150:31155592
dwcopilot:31170013
stablechunks:31184530
6074i472:31201624

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Dec 18, 2024
@FengChendian
Copy link

Me,too.

Extension use wrong command conda run -n .conda to activate, so it can not find local conda.

@karthiknadig karthiknadig added the bug Issue identified by VS Code Team member as probable bug label Dec 19, 2024
@karthiknadig karthiknadig self-assigned this Dec 23, 2024
@karthiknadig
Copy link
Member

Please try the pre-release version, it has some fixes for this.

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

3 participants