Python Installation
on macOS:
Using Homebrew (recommended):
- Open Terminal.
- Install Homebrew
bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"- Once Homebrew is installed, type
bash
brew install pythonUsing the Python macOS installer:
- Visit the official Python website at https://www.python.org/downloads/.
- Download the latest version of Python for macOS.
- Double-click the downloaded .pkg file and follow the installation instructions.
Using MacPorts:
- Install MacPorts from https://www.macports.org/install.php.
- Open Terminal.
- Type
bash
sudo port install python3on Linux:
Using package manager (for Debian/Ubuntu):
- Open Terminal.
- Update the package lists.
bash
sudo apt update- Install python3
bash
sudo apt install python3Using package manager (for CentOS/Fedora):
- Open Terminal.
- for CentOS
bash
sudo yum install python3- for Fedora
bash
sudo dnf install python3on Windows:
Using the Python Windows installer:
- Visit the official Python website at https://www.python.org/downloads/windows/.
- Download the latest version of Python for Windows.
- Run the downloaded .exe file and follow the installation wizard.
Using Chocolatey (package manager for Windows):
- Open PowerShell as Administrator.
- Type
bash
choco install pythonUsing Scoop (another package manager for Windows):
- Open PowerShell.
- Type
bash
scoop install pythonVerify installation
After installing Python, you can verify the installation by opening a terminal or command prompt and typing python3 --version (or simply python --version on Windows). You should see the installed Python version displayed.