domingo, 25 de janeiro de 2026

Guide: Installing many pythons in Ubuntu without uv or pyenv

 Run  the commands to install:

sudo add-apt-repository ppa:deadsnakes/ppa

sudo apt update

sudo apt install python3.9 python3.10 python3.11

After that, configure the uptade-alternatives:

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.9 9

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.10 10

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.11 11

Then to use, just choose the default, choose the alternative:

sudo update-alternatives --config python 

At the end, if you want to use venv in any project, just create the virtual env like this:

python3.xx -m venv .venv

source .venv/bin/activate 

If the first command raises error, maybe you need to install:

sudo apt install python3.xx-venv

Nenhum comentário:

Postar um comentário