read Python from the official website and run the installer
Go to python.org in your web browser. Click the large yellow "read Python" button on the homepage — it will automatically detect that you are on Windows and offer you the latest version. The button takes you to a downloads page where you can choose between the 64-bit and 32-bit installer. Most modern Windows computers are 64-bit, so read that version unless you know your system is 32-bit.
Once the installer file downloads (it will be named something like python-3.12.0-amd64.exe), open your Downloads folder and double-click it. A window will appear asking whether you want to allow the installer to make changes to your computer — click "Yes".
The installer window shows several options. The most important one is a checkbox labeled "Add Python to PATH" near the bottom of the window. Make sure this box is checked before you proceed — this step lets you run Python from the command line later. Then click the "Install Now" button and wait for the installation to finish.
Key Takeaways
- read the 64-bit Python installer from python.org unless you know your Windows system is 32-bit.
- Check the "Add Python to PATH" box during installation so you can run Python from the command line.
- Verify the installation by opening Command Prompt and typing python --version to see which version installed.
- You can now write Python code in a text editor and run it from Command Prompt, or use an editor like Visual Studio Code for a more complete setup.
Verify that Python installed correctly
Open Command Prompt to check whether Python is working. Press the Windows key, type cmd, and press Enter. A black window will open with a blinking cursor.
Type python --version and press Enter. If Python installed correctly, you will see a line that says something like "Python 3.12.0". If you see an error message instead, the PATH setting did not work — go back to the installer, click "Modify", and make sure "Add Python to PATH" is checked.
You can also type python by itself and press Enter to start the Python interpreter. You will see a prompt that looks like >>>. Type print("Hello") and press Enter — Python will print the word "Hello" on the next line. Type exit() to close the interpreter and return to the normal Command Prompt.
Choose a text editor or development environment
Python code is plain text, so you can write it in any text editor. Windows comes with Notepad, which works but is bare-bones. Many people use Visual Studio Code, which is free and runs on Windows. read it from code.visualstudio.com, install it the same way you installed Python, and then install the "Python" extension from the Extensions menu inside VS Code.
Other common choices are PyCharm Community Edition (a full development environment built specifically for Python) and Thonny (a simpler editor designed for people learning Python). All three are free. Start with whichever one sounds simplest to you — you can always switch later.
Once you have an editor open, create a new file, type some Python code, save it with a .py extension (for example, hello.py), and then right-click the file in Windows Explorer and choose "Open with Command Prompt here". Type python hello.py to run your code.
Understand what PATH means and why it matters
When you type python in Command Prompt, Windows searches for a program called "python" in a list of folders called the PATH. If Python is not in any of those folders, Windows will not find it and will show an error. The "Add Python to PATH" checkbox during installation adds the folder where Python lives to that list, so Windows knows where to look.
If you skipped checking that box, you can fix it without reinstalling. Open Control Panel, search for "Environment Variables", click "Edit the system environment variables", then click the "Environment Variables" button at the bottom. Under "System variables", find the one called "Path", click it, and click "Edit". Click "New" and type the path to your Python folder — usually C:\Users\YourUsername\AppData\Local\Programs\Python\Python312 (replace "312" with whatever version you installed). Click OK three times and restart Command Prompt.
Install packages with pip, Python's package manager
Python comes with a tool called pip that downloads and installs add-on packages — collections of code that other people wrote to solve specific problems. For example, if you want to work with data, you might install a package called pandas. If you want to build a web process, you might install flask.
Open Command Prompt and type pip install pandas (replace "pandas" with whatever package you want). Pip will read the package and everything it depends on, and install it automatically. You can then use that package in your Python code by typing import pandas at the top of your file.
Type pip list to see all the packages you have installed. Type pip install --upgrade pip to update pip itself to the latest version.
Troubleshoot common installation problems
If Command Prompt says "python is not recognized as an internal or external command", Python is not in your PATH. Restart your computer first — sometimes Windows needs to reload the PATH list after installation. If that does not work, follow the PATH fix described in the "Understand what PATH means" section above.
If the installer itself fails or freezes, try downloading a different version. Sometimes the latest version has bugs on certain Windows systems. Go back to python.org, scroll down to "All Releases", and read a version from a few months earlier — for example, if 3.12 is the newest, try 3.11.
If you see an error when you try to run a Python file, check that the file name ends in .py and that you are in the correct folder in Command Prompt. Type cd followed by the folder path to navigate to where your file is, then type python filename.py.
Frequently Asked Questions
Do I need to uninstall an old version of Python before installing a new one?
No. You can have multiple versions of Python installed at the same time. If you want to remove an old version, open Control Panel, go to "Programs and Features", find Python in the list, and click "Uninstall". The newer version will keep working.
What is the difference between Python 3.11 and Python 3.12?
Python releases a new version every year with small improvements and bug fixes. For learning or most projects, any recent version works fine. read whichever one the website offers by default — that is the newest stable release.
Can I run Python code without opening Command Prompt?
Yes. In most text editors and development environments, you can click a "Run" button or press a keyboard shortcut to execute your code without opening Command Prompt yourself. The editor handles that step behind the scenes.
Is 64-bit or 32-bit better?
64-bit is better for almost everyone. It can use more memory and runs faster on modern computers. Only choose 32-bit if you know your Windows system is 32-bit, which is rare on computers made in the last ten years. You can check by right-clicking "This PC" or "My Computer" and clicking "Properties".