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:
- VS code in windows using bash
- Remote SSH (v0.112.0)
- WSL (v0.88.2)
- Python is installed and executed in ubuntu (v2024.8.1)
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!
2
Answers
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.You should not switch to another Python interpreter. The problem is sourced from the Microsoft Python extension. They corrected it on the pre-release version of the extension. You can switch to it from the extension manager tab.
Or, simply wait for the update 😉