0

I have two installations of python (3.7 and 3.8) under two different usernames on my machine.

Python 3.7 is on my PATH and in folder C:\\users\username1\appdata\local\programs\python\python37-32\python.exe

I also have python 3.8 which came with miniconda and it is in a folder C:\Users\username2\miniconda3\python.exe

Miniconda is NOT my path (as recommended).

Both users have administrator privileges. What's the best way to switch between these two versions in VS Code?

PS: Should I consider adding miniconda (or just the destination to python3.8) to my PATH?

Swaroop Humane
  • 1,770
  • 1
  • 7
  • 17
sbhhdp
  • 353
  • 1
  • 3
  • 12
  • 1
    Did you check the [official documentation](https://code.visualstudio.com/docs/python/environments) ? – AMC Aug 06 '20 at 23:47
  • The users may be administrators, but without elevating via "run as administrator", by default username1 has no access to the profile directory of username2, and vice versa. First, from an elevated administrator command prompt, you will have to grant username1 at least read and execute access to "C:\Users\username2\miniconda3". For example, `icacls "C:\Users\username2\miniconda3" /grant username1:(OI)(CI)(RX)`. – Eryk Sun Aug 07 '20 at 06:02
  • Does this answer your question? [Use different Python version with virtualenv](https://stackoverflow.com/questions/1534210/use-different-python-version-with-virtualenv) – Trenton McKinney Sep 05 '20 at 20:59
  • [Real Python: An Effective Python Environment: Making Yourself at Home](https://realpython.com/effective-python-environment/) – Trenton McKinney Sep 05 '20 at 21:01
  • Does this answer your question? [Create empty conda environment](https://stackoverflow.com/questions/35860436) – Trenton McKinney Sep 05 '20 at 21:04
  • Does this answer your question? [create anaconda python environment with all packages](https://stackoverflow.com/questions/38066873) – Trenton McKinney Sep 05 '20 at 21:05

1 Answers1

1

My suggestion is to use conda to create enviornments for each project. Then you can use conda to switch between those enviornments.

Code-Apprentice
  • 81,660
  • 23
  • 145
  • 268
  • In that case, can I point to both versions within VS Code? – sbhhdp Aug 06 '20 at 15:14
  • @sbhhdp I'm not familiar with VSCode. The editors I use allow me to specify which environment I'm using for each project. I don't know if VS Code has similar settings or not. – Code-Apprentice Aug 06 '20 at 19:34