appendix-e
Appendix E. Python setup
This section provides instructions for installing Python on Windows, Linux, and macOS, and setting up a virtual environment for managing project dependencies.
E.1 Installing Python on Linux
For most Linux distributions, Python can be installed using a package manager. For Ubuntu, follow these steps:
- Update your package manager:
sudo apt update
- Install Python using:
sudo apt install python3
- Create a symbolic link to use python instead of python3:
sudo ln -s /usr/bin/python3 /usr/bin/python
- Verify the installation by checking the version:
python --version
E.2 Installing Python on macOS
On macOS, Python can be installed using the Homebrew package manager. Follow these steps:
- Install Homebrew if it's not already installed by running:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Use Homebrew to install Python:
brew install python
- Verify the installation by checking the version:
python --version
E.3 Installing Python on Windows
On Windows, Python can be installed through the following steps:
- Visit the official Python website: https://www.python.org/downloads/.
- Download the latest Python installer for Windows.
- Run the installer. Make sure to check the box that says: "Add Python to environment variables".
- Follow the installation instructions. Once installed, verify the installation by opening your terminal and running:
python --version
NOTE
This should display the version of Python installed, for example, Python 3.12.1.