Skip to content

somumahadev/Programming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Programming

Install Python 3.9 and Set Up Virtual Environment on Ubuntu

Step 1: Update and Upgrade System

sudo apt update && sudo apt upgrade -y

Step 2: Install Required Dependencies

sudo apt install software-properties-common -y

Step 3: Add Deadsnakes PPA (For Latest Python Versions)

sudo add-apt-repository ppa:deadsnakes/ppa -y
sudo apt update

Step 4: Install Python 3.9

sudo apt install python3.9 python3.9-venv python3.9-dev -y

Step 5: Verify Python Installation

python3.9 --version

Step 6: Create a Virtual Environment

Navigate to Your Project Directory

mkdir myproject && cd myproject

Create Virtual Environment

python3.9 -m venv venv

Step 7: Activate Virtual Environment

For Bash, Zsh:

source venv/bin/activate

For Fish Shell:

source venv/bin/activate.fish

For Windows (if using WSL):

source venv/bin/activate

Step 8: Verify Virtual Environment

python --version  # Should show Python 3.9.x

Step 9: Install Required Python Packages

Example:

pip install --upgrade pip
pip install numpy pandas flask

Step 10: Deactivate Virtual Environment

To exit the virtual environment:

deactivate

Notes

  • Always activate the virtual environment before installing packages.
  • Use deactivate to exit the virtual environment when done.

Enjoy your Python 3.9 environment on Ubuntu! 🚀

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published