Skip to content

Virtual environment without activate script does not respect python.terminal.activateEnvironment setting #22898

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

Closed
tcuisset opened this issue Feb 11, 2024 · 2 comments
Assignees
Labels
info-needed Issue requires more information from poster triage-needed Needs assignment to the proper sub-team

Comments

@tcuisset
Copy link

Type: Bug

Behaviour

Expected vs. Actual

Actual

When selecting a Python virtual environment that has no bin/activate script (but has a pyvenv.cfg), then the Python extension will ignore the python.terminal.activateEnvironment setting and always prepend the venv bin directory to path.

Expected

When python.terminal.activateEnvironment=false, then the PATH is not changed (as happens with a regular python venv)

Steps to reproduce:

  1. Set python.terminal.activateEnvironment to false
  2. Run python -m venv venv
  3. Remove venv/bin/activate
  4. Open a new integrated terminal and check the terminal environment changes

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.10.12
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Venv
  • Value of the python.languageServer setting: Default
Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX

User Settings


languageServer: "Pylance"

terminal
• activateEnvironment: false

Extension version: 2024.0.1
VS Code version: Code 1.86.1 (31c37ee8f63491495ac49e43b8544550fbae4533, 2024-02-07T09:07:19.849Z)
OS version: Linux x64 6.1.0-1033-oem
Modes:
Connection to 'SSH: llruicms01' could not be established Canceled
Remote OS version: Linux x64 6.1.0-1033-oem

System Info
Item Value
CPUs 13th Gen Intel(R) Core(TM) i7-13800H (20 x 2880)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
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
Load (avg) 1, 1, 1
Memory (System) 62.48GB (47.55GB free)
Process Argv --unity-launch --crash-reporter-id cb172af6-c37b-483a-aabb-8af8f8ef1f33
Screen Reader no
VM 0%
DESKTOP_SESSION ubuntu
XDG_CURRENT_DESKTOP Unity
XDG_SESSION_DESKTOP ubuntu
XDG_SESSION_TYPE x11

Connection to 'SSH: llruicms01' could not be established Canceled

Item Value
Remote Dev Container
OS Linux x64 6.1.0-1033-oem
CPUs 13th Gen Intel(R) Core(TM) i7-13800H (20 x 2829)
Memory (System) 62.48GB (47.55GB free)
VM 0%
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Feb 11, 2024
@karrtikr
Copy link

Please provide the debug logs which can help diagnose the issue:

  • Run Developer: Set log level command
  • Select Trace
  • Run Developer: Reload Window command
  • Provide the output:
Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

XXX

@anthonykim1
Copy link

@tcuisset Can you check on the latest insider version of Python extension that you are having the same problem? It is likely resolved by #22909

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
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