-1

I'm trying to switch environments from my "venv-02: conda" to my "venv: venv" environment. I have selected the venv environment in my vsocde by clicking here and also in the select environment prompt from pressing control shift 5.

However my terminal environment doesn't change out of venc-02. What am I doing wrong? enter image description here

  • AFAIU, these are virtual environments. You can activate them by running the command: `source /bin/activate` – vagitus Oct 24 '22 at 10:36
  • @vagitus This doesnt work for me sorry. I get this error: >source venv-01/bin/activate 'source' is not recognized as an internal or external command, operable program or batch file – Michael Amos Oct 28 '22 at 08:53

1 Answers1

0

Use the following command to switch venv in the terminal:

conda active venv-01

enter image description here

You can also use shortcuts "ctrl+shift+P" and type "Python: Select Interpreter" to choose the venv then reload the vscode. When you try to run the file, it will automatically help you activate the conda environment.

MingJie-MSFT
  • 5,569
  • 1
  • 2
  • 13
  • Thank you but this doesn't seem to work, I'm guessing because it's not a conda environment? – Michael Amos Oct 28 '22 at 08:52
  • @MichaelAmosm If so, I'm not sure where your problem is. Could you please read the selection interpreter in the [docs](https://code.visualstudio.com/docs/python/environments#_work-with-python-interpreters) and tell me where the problem occurred? – MingJie-MSFT Oct 28 '22 at 09:40