How To Install Python 3.11.0 on Windows 10 or 11
How to download & install Python 3 on Windows (run simple Python program in VSCode)
To download Python head over to official Python site: www.python.org/downloads/
Click on download button next to "Download latest version of Python for Windows."
Head over to the link above. On official Python site, click the Download button. It should automatically adjust according to the operating system you're currently on. So by clicking on it you're always downloading the latest version of Python for your Operating System.
There are other links to Linux/UNIX, MacOS and Windows installers on that page. So choose the installation package for whatever OS you want to run it on.
Run the Python installer. Just click on the file that was downloaded. This will start Python installation window. Python constantly changes its installation options with every version.
Adding python.exe to PATH. On the first window on the Python 3.11.0 installer, make sure to check "Add python.exe to PATH checkbox." This will prevent you from having to add your new Python version to Environment Variables in Windows later on.
Adding python.exe to Environment Variables on Windows
In the previous step we checked "Add python to PATH" checkbox during installation. But not all Python installers are made alike.
If that option is missing, you have to add python.exe to your Environment Variables in Windows manually. Go to Start button, and start typing Environment Variables. Hit enter, or click on open button.
On this new window, go to Environment Variables, then in the second box below, locate System Variables. Scroll down to locate PATH variable on that list, click on it one time. Then click Add New button.
Scroll down to end of list and add C:\python3.11\ (or whatever folder you installed your Python to), and also add C:\python3.11\bin. Click OK 3 times and exist the window.
Why Do I Need To Add Python To PATH?
After you install Python, you can only run it directly from the installation directory on the command line, by first navigating there.
Normally you don't want to navigate to python installation folder every time you want to execute your program. And you shouldn't do that anyway.
By adding Python to Environment Variables on Windows, you ensure that python.exe can be executed from anywhere on the command line, regardless where you're currently are on the hard drive.
This is also why we add python to PATH variables on Windows, so that other IDEs like Visual Studio Code can run python independently directly from python project folder in Terminal.
Learn How To Run Python Code In Visual Studio Code
This tutorial is based on a YouTube video I recorded for Semicolon channel:
====== Video Chapters =====
- 00:00 How to download Python 3.11 on Windows
- 00:23 To download latest version of Python click Download Python 3.11.0 button
- 00:39 How to launch downloaded Python Installer
- 00:52 Add Python.exe to PATH (add python to environment variables)
- 01:47 Open Visual Studio Code (VSCode)
- 02:01 How to open Python project in VSCode
- 03:06 How to launch Python program in VSCode Terminal
- 03:13 Using py launcher to run Python code in VSCode command line
- 03:35 How to run Python code from command line (cmd.exe) in Windows
- 04:28 How to Install Python VSCode Extension
- 04:55 Discovering Python Interpreters in VSCode
- 05:09 How to change Python version in VSCode
- 05:58 How to change Python interpreter in Visual Studio Code
- 06:19 Running Simple Python Program: How to swap variables