permission-deniedpython-venv

bash: <path>/.vscode-server/extensions/ms-python.python-2024.8.1/python_files/deactivate/bash/deactivate: Permission denied


I am new to python on a freshly installed windows OS. I am running a venv in ubuntu linux and followed a guide to activate the venv. Everything was going smoothly until I tried to 'deactivate' the venv. I am getting this bash error when I try to deactivate the venv.

Not sure if this helps or not, but here is the system setup:

Any help is appreciated :) Have a good day!

I tried using deactivate to exit the python venv. I expected the (venv) to go away in terminal.

I tried cd'ing to scripts folder and other folders and running deactivate. Also sudo deactivate. I googled the error and nothing popped up on google. Some articles talk about executing an admin powershell however I am not sure how that applies to me since this is in linux. Maybe vs-code needs admin rights? I looked at the activate script in the venv folder, looked thru the deactivate command code, and do not see the error message I am getting.

EDIT: It went away when I created another VS-code window :) Yaaay!


Solution

  • I had the same issue, and I fixed it by changing the default Python interpreter for in my project. To do so press Ctrl+Shift+P and type Python: Select Interpreter. Chose one of the OS versions of Python.