# Your new Python version python3.12 --version python3 --version Updating pip and Virtual Environments After installing a new Python, update its pip:
Remember: there's no single "latest Python" command across all distros. Choose the approach that fits your workflow, and always verify your installation before running critical scripts. Updated April 2026 – Works with Python 3.12+ and all major Linux distributions. how to update python on linux
python3.12 -m pip install --upgrade pip Create a virtual environment to isolate packages: # Your new Python version python3
python3.12 --version pyenv lets you install and switch between multiple Python versions per project without touching system Python. Install pyenv # Install dependencies (same as source compilation) # Then run pyenv installer curl https://pyenv.run | bash Add to your ~/.bashrc (or ~/.zshrc ): how to update python on linux