Set Up Python on Windows 10: A Step-by-Step Guide
In this article
Yes, you can set up Python on Windows 10 in about 10 minutes by downloading the official installer from python.org, running it with the "Add Python to PATH" option checked, and verifying the installation with a simple command. This guide walks you through the exact steps, including how to avoid common pitfalls like PATH issues and multiple Python versions.
What You'll Need
- A Windows 10 PC with internet access.
- Administrator rights on the PC (needed to install Python system-wide; if you don't have them, you can still install per-user).
- A web browser (Edge, Chrome, Firefox, etc.).
Step-by-Step
- Download the Python installer. Go to the official Python downloads page at python.org/downloads. Click the yellow button that says "Download Python 3.x.x" (the latest stable version). The file will be named something like
python-3.12.4-amd64.exe. - Run the installer. Double-click the downloaded .exe file. If a User Account Control prompt appears, click "Yes" to allow the installer to make changes.
- Check the critical box. At the very bottom of the first installer window, check the box that says "Add Python to PATH". This is the single most important step—if you skip it, Python won't be recognized in the command prompt later.
- Choose the install method. Click "Install Now" for the default installation (recommended for most users). Alternatively, click "Customize installation" to change the install location or features, but the default is fine for most.
- Wait for the installation to finish. The installer will show a progress bar. When it completes, you'll see a screen that says "Setup was successful." Click "Close".
- Verify the installation. Open Command Prompt by pressing Windows + R, typing
cmd, and pressing Enter. Then typepython --versionand press Enter. You should see something likePython 3.12.4. If you see an error, see the Troubleshooting section below. - Verify pip (Python's package installer). In the same Command Prompt, type
pip --versionand press Enter. You should see something likepip 24.0 from C:\...\site-packages\pip (python 3.12). If pip isn't found, see Troubleshooting. - Optional: Test with a simple script. Create a file named
hello.pyon your desktop with a text editor (like Notepad) containingprint("Hello, World!"). Then in Command Prompt, navigate to the Desktop (cd Desktop) and runpython hello.py. You should seeHello, World!printed.
Common Mistakes
- Forgetting to check "Add Python to PATH". This is the #1 mistake. Without it, the
pythoncommand won't work in Command Prompt. If you already installed without it, you can repair by re-running the installer and choosing "Modify", then checking the option. - Installing both 32-bit and 64-bit versions. If you have both, you may get confusion about which one runs. Stick to the 64-bit version (the default download is 64-bit on modern PCs).
- Using the Microsoft Store version accidentally. The Microsoft Store has a Python app, but it can be outdated and may not behave exactly like the official one. Use the official installer from python.org to avoid inconsistencies.
- Not closing and reopening Command Prompt after installation. If you had Command Prompt open during installation, it won't see the new PATH changes. Close it and open a new one.
Tips
- Use a code editor. While Notepad works, a code editor like Visual Studio Code (free) gives you syntax highlighting, debugging, and a built-in terminal. You can install the Python extension for VS Code to make running scripts easier.
- Learn to use virtual environments. For real projects, use
python -m venv myenvto create an isolated environment. This prevents package conflicts between projects. Activate it withmyenv\Scripts\activate(Windows). - Keep Python updated. Periodically check python.org for new versions. You can upgrade pip itself with
python -m pip install --upgrade pip. - Set the execution policy for scripts (if needed). If you later want to run PowerShell scripts with Python, you may need to allow them. But for basic setup, this is not necessary.
Troubleshooting
If "python" is not recognized:
- Check that you added Python to PATH during installation. If not, re-run the installer, select "Modify", and check "Add Python to PATH".
- Close and reopen Command Prompt. The PATH is only read at startup.
- If it still fails, manually add Python to PATH: open System Properties (right-click This PC > Properties > Advanced system settings), click "Environment Variables", find the "Path" variable under System variables, edit it, and add the folder where Python is installed (e.g.,
C:\Users\YourName\AppData\Local\Programs\Python\Python312) and theScriptssubfolder (e.g.,...\Python312\Scripts).
If "pip" is not recognized:
- Ensure Python is installed correctly. If
python --versionworks butpipdoesn't, trypython -m pip --version. If that works, add theScriptsfolder to PATH as described above. - If pip is missing entirely, you can install it by running
python -m ensurepip --upgrade.
If the installer fails or is blocked:
- Right-click the installer and select "Run as administrator".
- Make sure your Windows is updated to the latest service pack.
- If you see a "Windows protected your PC" warning, click "More info" and then "Run anyway"—this is common for unsigned installers, but the official python.org installer is safe.
If you have multiple Python versions:
- Use
py --versionto check the Python Launcher (which is installed with Python). You can runpy -3to use Python 3 specifically, orpy -3.12for a specific version. - To avoid confusion, uninstall older versions you don't need, or always use the
pylauncher.
Frequently Asked Questions
Do I need to install Python from the Microsoft Store instead?
No. The Microsoft Store version is a simplified install that may not include all tools like pip, and it can lag behind the official release. Use python.org for the full, official installation.
What's the difference between Python 2 and Python 3?
Python 2 is outdated and no longer supported. Always install Python 3 (the latest version like 3.12 or 3.13). Most tutorials and libraries assume Python 3.
Can I install Python on a USB drive or external device?
It's possible to create a portable Python installation, but it's not recommended for beginners. The standard installation on your internal drive is simpler and more reliable.
How do I uninstall Python if I change my mind?
Go to Settings > Apps > Apps & features, find Python, and click Uninstall. You may also want to remove the Python folders from PATH manually if they remain.
Why does my antivirus flag the Python installer?
Some antivirus programs may flag any new executable. The official installer from python.org is safe. If you get a warning, verify the file's digital signature (right-click > Properties > Digital Signatures) to confirm it's from the Python Software Foundation.
Do I need to install an IDE like PyCharm or Anaconda?
No. The base Python installation includes the IDLE editor, which is enough for learning. Visual Studio Code is a free, lightweight alternative. Anaconda is useful for data science but not required for general Python.