Skip to content

Python Virtual Env activates with two parenthesis #23205

Closed

Description

@jascomp

Type: Bug

Behaviour

After the VSCode March 2024 Update I noticed that when I open a new Terminal with automatic Python environment activation it is showing the prompt with two sets of parenthesis:

((.venv) ) myuser@ubuntu23:~/src/myapp$

Where before it was:

(.venv) myuser@ubuntu23:~/src/myapp$

The above is also what I get when I activate the environment manually:

source .venv/bin/activate

I'm running the Terminal in VSCode through a remote SSH connection.

There's been no changes to the host box and my application seems to run without issues, but it's just odd.

I've tried removing the .vscode-server and .vscode directories on the remote host and letting VSCode recreate them.

Steps to reproduce:

  1. Auto activate Python environment in remote SSH Terminal

VS Code version: Code 1.88.0 (5c3e652f63e798a5ac2f31ffd0d863669328dc4c, 2024-04-03T13:26:18.741Z)
OS version: Windows_NT x64 10.0.22631
Modes:
Remote OS version: Linux x64 6.5.0-26-generic

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


languageServer: "Pylance"

Installed Extensions
Extension Name Extension Id Version
Docker ms-azuretools.vscode-docker 1.29.0
GitHub Copilot GitHub.copilot 1.178.0
GitHub Copilot Chat GitHub.copilot-chat 0.14.0
isort ms-python.isort 2023.10.1
JavaScript Debugger ms-vscode.js-debug 1.88.0
Pretty XML PrateekMahendrakar.prettyxml 4.4.1
Pylance ms-python.vscode-pylance 2024.4.1
Python ms-python.python 2024.4.0
Python Debugger ms-python.debugpy 2024.4.0
Table Visualizer for JavaScript Profiles ms-vscode.vscode-js-profile-table 1.0.8
System Info
Item Value
CPUs 12th Gen Intel(R) Core(TM) i7-1255U (12 x 2611)
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
Load (avg) undefined
Memory (System) 63.69GB (40.98GB free)
Process Argv --crash-reporter-id 464d6f4d-8cf9-4523-82f9-3fc9adea2ade
Screen Reader no
VM 0%
Item Value
Remote SSH: local.linux.peaketl.com
OS Linux x64 6.5.0-26-generic
CPUs Intel(R) Core(TM) i5-7500T CPU @ 2.70GHz (4 x 3108)
Memory (System) 31.22GB (27.61GB free)
VM 0%
Extensions (19)
Extension Author (truncated) Version
python ms- 2024.4.0
jupyter-keymap ms- 1.1.2
remote-containers ms- 0.354.0
remote-ssh ms- 0.110.1
remote-ssh-edit ms- 0.86.0
remote-wsl ms- 0.88.0
vscode-remote-extensionpack ms- 0.25.0
remote-explorer ms- 0.4.3
remote-server ms- 1.5.1
es7-react-js-snippets rod 1.9.3
pdf tom 1.2.2
copilot Git 1.178.0
copilot-chat Git 0.14.0
vscode-docker ms- 1.29.0
debugpy ms- 2024.4.0
isort ms- 2023.10.1
python ms- 2024.4.0
vscode-pylance ms- 2024.4.1
prettyxml Pra 4.5.0
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:30899288
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythongtdpath:30769146
welcomedialog:30910333
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2:30936856
pyreplss1:30897532
pythonmypyd1:30879173
pythoncet0:30885854
h48ei257:31000450
pythontbext0:30879054
accentitlementsc:30995553
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
d34g3935:30971562
fegfb526:30981948
bg6jg535:30979843
ccp2r3:30993541
dsvsc020:30976470
pythonait:31006305
gee8j676:31009558
dsvsc021:30996838
g1icg217:30999571
vstestt:31010172

Activity

  1. changed the title [-]Python Virtual Env activates with two parathesis[/-] [+]Python Virtual Env activates with two parenthesis[/+] on Apr 6, 2024
  2. maxbobkov commented on Apr 6, 2024

    @maxbobkov

    I have the same problem on Mac OS, when activate virtual environment and use command 'which python', terminal shows me path to global interpreter.

  3. blazerzar commented on Apr 8, 2024

    @blazerzar

    Same problem for me on Mac OS.

    I have the same problem on Mac OS, when activate virtual environment and use command 'which python', terminal shows me path to global interpreter.

    For me, which python works correctly, but I have noticed that deactivate command does not work. I get zsh: permission denied: deactivate error.

    Downgrading the Python extension to v2024.2.1 fixed the problem.

  4. karthiknadig commented on Apr 8, 2024

    @karthiknadig
    Member

    Duplicate of #23193

    Fixed via #23201

  5. jascomp commented on Apr 9, 2024

    @jascomp
    Author

    Confirm deactivate permission denied issue reported by Blaž Erzar (@blazerzar)

  6. karthiknadig commented on Apr 9, 2024

    @karthiknadig
    Member

    Jason Holden (@jascomp) Blaž Erzar (@blazerzar) Deactivate permission error tracking issue #23195

  7. psonis-certh commented on Apr 10, 2024

    @psonis-certh

    Pre-release version (v2024.5.11002139) fixed the double parenthesis issue for me.

  8. locked as resolved and limited conversation to collaborators on May 11, 2024
  9. anthonykim1 commented on Jun 12, 2025

    @anthonykim1

    We are planning to deprecate terminal environment experiment in favor of shell activation coming from python environment extension.

    Could people try out the Python environment extension(https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-python-envs) with
    python-envs.terminal.autoActivationType set to shell startup?

    This is supposed to be the "better"/"proper" activation without showing the source... activate on your terminal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

info-neededIssue requires more information from postertriage-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