vscode-python: Deactivate Script in remote server is Permission denied

Type: Bug

When creating a virtual environment with python3 -m venv env and then opening the terminal

((env) ) randark@developer:~/code/20240407-ssti$ 

Anomalous double-bracket-wrapped environment hints appear

At the same time, when trying to de-activate the virtual environment, an anomalous insufficient permissions message appears

((env) ) randark@developer:~/code/20240407-ssti$ deactivate
bash: /home/randark/.vscode-server/extensions/ms-python.python-2024.4.0/python_files/deactivate/bash/deactivate: Permission denied

Extension version: 2024.4.0 VS Code version: Code 1.87.2 (863d2581ecda6849923a2118d93a088b0745d9d6, 2024-03-08T15:20:17.278Z) OS version: Windows_NT x64 10.0.22631 Modes: Unsupported Remote OS version: Linux x64 6.5.0-17-generic

System Info
Item Value
CPUs 13th Gen Intel® Core™ i7-13620H (16 x 2918)
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 (34.22GB free)
Process Argv –crash-reporter-id c9f4871d-20e2-430d-8db2-04870357e670
Screen Reader no
VM 29%
Item Value
Remote SSH: Developer
OS Linux x64 6.5.0-17-generic
CPUs 13th Gen Intel® Core™ i7-13620H (4 x 2918)
Memory (System) 7.71GB (5.26GB free)
VM 29%
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805cf:30301675
binariesv615:30325510
vsaa593:30376534
py29gd2263:30899288
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythongtdpath:30769146
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2:30936856
pyreplss1:30897532
pythonmypyd1:30879173
pythoncet0:30885854
h48ei257:31000450
pythontbext0:30879054
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

About this issue

  • Original URL
  • State: open
  • Created 3 months ago
  • Reactions: 25
  • Comments: 18

Most upvoted comments

On local venvs deactivate also doesnt work and gives zsh: permission denied.

Fix is the same: sudo chmod +x ~/.vscode/extensions/ms-python.python-2024.4.1/python_files/deactivate/zsh/deactivate

I am on mac M1pro with zsh.

For work around -> With root access you can give rights to deactivate file with chmod. sudo chmod 777 .vscode-server/extensions/ms-python.python-2024.4.0/python_files/deactivate/bash/deactivate

chmod +x ~/.vscode/extensions/ms-python.python-2024.4.1/python_files/deactivate/zsh/deactivatechmod 777

I’m running into the same issue on my MAC. Here are the specific details of my VSCode setup:

Version: 1.87.1 (Universal)
Commit: 1e790d77f81672c49be070e04474901747115651
Date: 2024-03-06T00:23:16.418Z (1 mo ago)
Electron: 27.3.2
ElectronBuildId: 26836302
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Darwin arm64 23.3.0

Update: Following @ykursav’s answer, I ran a slightly modified command

sudo chmod 777 /root/.vscode-server/extensions/ms-python.python-2024.4.0/python_files/deactivate/bash/deactivate
deactivate

and now everything works!

+1

Pop!_OS 22.04 LTS VSCode 1.88.0 Commit: 5c3e652f63e798a5ac2f31ffd0d863669328dc4c

Found this comment recommending to downgrade the Python Extension from 2024.4.0 to 2024.2.1 which after a VSCode refresh and restarting the terminal, resolved the issue for me.

+1

Pop!_OS 22.04 LTS VSCode 1.88.0 Commit: 5c3e652f63e798a5ac2f31ffd0d863669328dc4c

Found this comment recommending to downgrade the Python Extension from 2024.4.0 to 2024.2.1 which after a VSCode refresh and restarting the terminal, resolved the issue for me.

This worked for me on VSCode Insiders v1.89.0-insider