Skip to content

Recommended way of managing different python versions for different virtual environements

Notifications You must be signed in to change notification settings

sshuen30/maintain_multiple_python_versions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 

Repository files navigation

How to maintain different python versions

  • Assuming your current ubuntu has python 3.10 installed and you want to install python 3.9
# Install the 'software-properties-common to add external repositories to your package manager's list of available sources.
sudo apt-get install software-properties-common

# Add the deadsnakes repository
sudo add-apt-repository ppa:deadsnakes/ppa

# Update package lists
sudo apt update

# Install Python 3.9
sudo apt install python3.9
  • Install the venv package and create a venv virtual environment
# Install the venv package for Python 3.9
sudo apt install python3.9-venv

# Create your project folder and cd into the folder 
mkdir /home/project

# Create a new venv virtual environment (name: myproject) with Python 3.9 in it
python3.9 -m venv myproject

# Activate the new venv
source myproject/bin/activate

# In the virtual environment, verify that your python version is 3.9
python3

About

Recommended way of managing different python versions for different virtual environements

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published