linux and python - zamaniamin/python GitHub Wiki
Update the package list
sudo apt-get update
Install Python 3
sudo apt-get install python3
or install a specific Python version, e.g., Python 3.11
sudo apt-get install python3.11
sudo apt-get install python3-venv
python3.11 --version
sudo ln -s /usr/bin/<python3.11> /usr/local/bin/python
Note: Changing the default Python command can lead to compatibility issues with some scripts or programs that rely on specific Python versions. Use this with caution and ensure that your system and applications are compatible with the desired Python version.
sudo apt-get install python3-pip
Verify the installation
pip3 --version
List installed packages on Debian
dpkg --list