Installing Python
8/26/26About 2 minAbout 335 words
Installing Python
To begin scripting, you need the Python Interpreter—the engine that reads your code and translates it into instructions the CPU can understand.
Windows does not come with Python preinstalled. Follow these steps to ensure a clean installation:
- Download: Visit python.org. Download the latest stable release (e.g., Python 3.x.y). We recommend you download the standalone installer instead of the Python install manager.
- The Critical Step (PATH): Run the installer.
- Crucial: Before clicking "Install Now," check the box at the bottom that says "Add Python to PATH."
- Why? If you don’t add Python to the PATH, your Command Prompt (CMD) or PowerShell won’t know what the command python means, and you will get the error: 'python' is not recognized as an internal or external command.
- Crucial: Before clicking "Install Now," check the box at the bottom that says "Add Python to PATH."
- Customization: Select "Customize installation" to ensure pip (the package manager) is installed. pip is what allows you to install libraries for networking, SSH, and cloud management.
- Verification: Open PowerShell and type:
python --versionYou should see Python 3.x.y.
MacOS comes with Python preinstalled, but it is often an older version. To ensure you have the latest version, follow these steps:
- Check Existing Versions: Open the terminal and type:
python --versionIf the version is older than 3.6.x or if you want to install a newer version, proceed to the next step.
- Install Homebrew: If you don’t have Homebrew (a package manager) installed, you can install it by running the following command in the terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"- Install Python: Once Homebrew is installed, you can install the latest version of Python by running:
brew install python- Check Existing Versions: Open the terminal and type:
python --versionInstalling/Updating via Package Manager:
- Ubuntu/Debian:
sudo apt update sudo apt install python3 python3-pip- RHEL/CentOS/Fedora:
sudo yum install python3