-
-
Notifications
You must be signed in to change notification settings - Fork 37
Upgrade Python Version in Windows
An UBA user asked about how to upgrade python version in Windows. In reply to the question, we provide brief notes below:
- Download the latest python version from:
https://www.python.org/downloads/
(At the time of writing, the latest python version for Windows is 3.11.2. Instructions below are based on this version.)
-
Run the installer to install the latest python
-
From Windows search bar, search for "Python 3.11 (64-bit)", open it, and run:
import sys
print(sys.executable)
- Copy the python path shown on the terminal, without \python.exe, in this example:
C:\Users\yourUserName\AppData\Local\Programs\Python\Python311
Please note that yourUserName should be changed to your user name.
-
From Windows search bar, search for "View advanced system settings", open it, and click the "Environment Variables" button.
-
Select "PATH" under "User variables" and click "Edit"
-
On "Edit environment variable" window, click "New" and enter:
C:\Users\yourUserName\AppData\Local\Programs\Python\Python311
Click "OK" and "Move Up" until it reaches the top.
- On "Edit environment variable" window, click "New" and enter:
C:\Users\yourUserName\AppData\Local\Programs\Python\Python311\Scripts
Click "OK" and "Move Up" until it reaches the top.
- Verify your python version in terminal by running:
python
You should see "Python 3.11.2 ..."
You may need to restart Windows to see the changes
Remarks: There are different ways to upgrade python version on Windows. The example above is only one of the ways.