Python Update Linux |top| -
ls /usr/bin/python* /usr/local/bin/python* ~/.pyenv/versions/ 2>/dev/null Switch temporarily:
python3.12 --version Version managers let you install multiple Python versions per user without sudo . pyenv (Most popular) # Install pyenv curl https://pyenv.run | bash Add to ~/.bashrc echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bashrc echo 'eval "$(pyenv init -)"' >> ~/.bashrc source ~/.bashrc Install a new Python version pyenv install 3.12.2 pyenv global 3.12.2 # set as default for your user conda / miniconda Great for data science and isolated environments. python update linux
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1 sudo update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.12 2 sudo update-alternatives --config python3 After updating Python, update pip : ls /usr/bin/python* /usr/local/bin/python* ~/