Python Tutorial: How to Set the Path and Switch Between Different Versions/Executables (Windows)
Why Stack Overflow recommends it
Stack Overflow users link it in answers about Python installs, 'module not found' errors and multiple Python versions on Windows, where the real fix is getting PATH set correctly.
Recommended by 2 people across 2 different months, 2020 to 2022.
What it is
A Corey Schafer tutorial on setting the PATH environment variable on Windows and using it to switch between different Python versions and executables. It walks through the Windows environment settings step by step and is a companion to his Mac and Linux version.
What people said
Recommends nitesh · 2020-04 · Stack Overflow · on “Error during installation of Dlib library on Windows 10 computer”
Below steps I used to install Dlib on Windows: Pre-Requisite : 1) Install Python 3.6 64-bit . If you have Python 32-bit, you need to install Python 3.6 64-bit. Please note, you can not have both Python versions running at same time. If you are intended to run Python 3.6 64-bit, then you need keep Python 3.6 library paths at first position in System and User environment paths. Visit this tutorial for more info on switching between python versions: Tutorial on switching between Python Versions [this video] 2) Install cmake library: Click link – Cmake Installer [LINK] and install Cmake. Otherwise, open CMD: install cmake library using pip: pip install cmake Give path of cmake library in System Envir
Recommends Pruthvi Amin · 2020-05 · Stack Overflow · on “Why am i getting a ModuleNotFoundError: No module named 'pyperclip'?”
I found the solution. The problem was that my IDE (Spyder) was searching in the wrong folder for downloaded modules. All modules downloaded using pip get downloaded to the c:\users\USERNAME\appdata\local\programs\python\python38-32\lib\site-packages directory by default. So I simply set my PATH (where the interpreter searches for files) to this directory. Corey Schafer has a great video on how to set a PATH: [this video]
Cites JoraSN · 2022-02 · Stack Overflow · on “Module appearing as uninstalled even though it installed”
Instead of deleting one version of python and keeping the other(as mentioned in the other answer) you can keep both. For example if I have python 3.9 and python 3.10 I can use environment variables to tell my system which interpreter I want to use. For windows There are two ways to do this on windows computers(one way might work on your computer, the other may not). First Way To set two interpreters on windows you can search up "control panel" in your windows search bar. Then go to "system and security". On the top right corner their will be a search bar in it type "advanced system settings" till you get something like this: [LINK] Click on "advanced system settings". You will get something