Skip to content

Upgrade Python Version in Windows

Eliran Wong edited this page Feb 22, 2023 · 2 revisions

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:

  1. 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.)

  1. Run the installer to install the latest python

  2. From Windows search bar, search for "Python 3.11 (64-bit)", open it, and run:

import sys

print(sys.executable)

  1. 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.

  1. From Windows search bar, search for "View advanced system settings", open it, and click the "Environment Variables" button.

  2. Select "PATH" under "User variables" and click "Edit"

  3. 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.

  1. 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.

  1. 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.

Clone this wiki locally