Logo

Python Installation Guide

Python Installation Guide

Python is a versatile and easy-to-learn programming language used for everything from web development to automation, data science, and machine learning. This guide explains how to install Python, manage versions, and configure the environment to run your scripts efficiently.

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

Join our Discord community server

For any questions, suggestions, or just to chat with the community, join us on Discord!

900+Members