Python Installation Guide
1. Check the current Python version
python3 --version
2. Update the repositories
sudo apt update && sudo apt update -y
3. Install Python 3 and pip
sudo apt install python3 python3-pip -y
python3 --version
pip3 --version
4. Install a virtual environment (optional)
sudo apt install python3-venv -y
python3 -m venv myenv
source myenv/bin/activate
To exit the environment:
deactivate
5. Update pip
python3 -m pip install --upgrade pip
6. Install Python Packages
pip install package_name
7. Additional Tips
Check Python's location:
which python3
Check pip's location:
which pip3
Run a Python script:
python3 myscript.py


















