Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vs code deactivate venv not inside workspace

I am using VS code and have a venv folder for shared projects that lives outside of workspace/project folders. I want to change my workspace to use the interpreter within my AppData\local... folder (system installation of Python). I have been reading up on this but not found a solution to do this. How would I do this please?

enter image description here

I should note that the virtual environment is not active so I can not do this.

In the terminal I see this showing the workspace folder & the virtual environment. enter image description here

This is messing up my debugging and very frustrating.

Edit - to try better explain when opening my interpreter list (see image below). Each workspace (red box) has the interpreter named under it (green box). I want to change the interpreter that is linked to the workspace.

enter image description here

Edit2 - solution - So I was able to fix this by doing something I had tried before but for some reason this time it worked. Which was selecting the 'Select at workspace level' option.

enter image description here

Then I selected the interpreter and this time it allowed me to browse for the interpreter on my computer which then updated the interpreter. Don't see what the problem was but it worked.

enter image description here

like image 703
Cam Avatar asked Aug 25 '26 21:08

Cam


1 Answers

You can use shortcuts "ctrl+shift+P" and type "Python: Clear Workspace Interpreter Settings" AND "Python: Select Interpreter" to change the environment.

By default, the Python extension looks for and uses the first Python interpreter it finds in the system path. To select a specific environment, use the Python: Select Interpreter command from the Command Palette (Ctrl+Shift+P).

You can refer to the docs for more details.

like image 89
MingJie-MSFT Avatar answered Aug 28 '26 10:08

MingJie-MSFT



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!