Install Python
Install Python
Section titled “Install Python”This page covers the practical minimum: install Python, verify it works, and avoid the most common setup mistakes.
Step 1. Install Python
Section titled “Step 1. Install Python”Download Python from the official site:
Choose a current Python 3 release unless your project explicitly requires an older version.
Step 2. Pay Attention During Installation
Section titled “Step 2. Pay Attention During Installation”Windows
Section titled “Windows”- Enable the option to add Python to
PATH. - Install
pipif it is not already selected. - If you are unsure, the default install is usually enough.
- Use the official installer or your preferred package manager.
- Verify which interpreter you are actually using after installation.
Many distributions already include Python, but not always the version you want. Install or update it with your package manager when needed.
Step 3. Verify the Interpreter
Section titled “Step 3. Verify the Interpreter”Run one of these commands:
python --versionor:
python3 --versionThen verify pip:
python -m pip --versionStep 4. Test a Simple Script
Section titled “Step 4. Test a Simple Script”Create a file named hello.py:
print("Hello, Python")Run it:
python hello.pyIf that works, your machine is ready for the next step.
Common Issues
Section titled “Common Issues”python is not recognized
Section titled “python is not recognized”The interpreter is either not installed correctly or is not on PATH.
pip installs to a different Python version
Section titled “pip installs to a different Python version”Use python -m pip ... so the package manager runs under the interpreter you intend to use.
Multiple Python versions are installed
Section titled “Multiple Python versions are installed”That is normal. Just be deliberate about which interpreter your project uses.