Python on Linux Mint
Linux Mint comes with Python 3 pre-installed. If you just open a terminal and type python3 --version, you will likely see something like Python 3.10 or 3.12 depending on your release. It works for basic scripting and the default system tools depend on it staying there, so you do not touch that installation. But if you are running projects that need a newer version than what Mint ships, or you want to use virtual environments without fighting your package manager, there is a way to get Python properly set up. This is where Unlock The Power Of Python On Linux Mint A Quick And Easy Installation Guide becomes relevant, and I have used these exact steps across multiple Mint installs over the years.
Checking What You Already Have
Open a terminal. Run these two commands and note the output: python3 --version which python3
On Linux Mint 21.x, you will usually get Python 3.10. On 22, it is typically 3.12. The path will point to /usr/bin/python3. This is the system Python, managed by APT. Do not replace it. Do not run apt install python3 if it is already there, because you will just be confirming something that is already installed.
Get the Full Details

Installing a Newer Python Version
The most practical method is using the deadsnakes PPA. I have used this approach since Mint 19. It is stable, predictable, and does not break system dependencies when done correctly. First, make sure you have the prerequisites: sudo apt update
sudo apt install software-properties-common Then add the PPA: sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update Then install the version you need: sudo apt install python3.12 python3.12-venv python3.12-dev

I typically install the -venv and -dev packages too, even if you think you do not need them. Projects like compiling C extensions for NumPy or psycopg2 will fail later if those packages are missing, and fixing that after the fact is annoying. After installation, verify it: python3.12 --version
You should see the version you just installed. The system python3 command still points to the Mint-shipped version. That is intentional and correct.
Setting Up Virtual Environments
This is where most people on Linux Mint run into trouble. They try to use python3 -m venv and get errors, or they install packages globally and break something. Here is the straightforward way to do it with the newer Python. Create a project directory. Navigate into it. Then run: python3.12 -m venv myproject

Activate it: source myproject/bin/activate Your prompt will change. Type which python and confirm it points inside myproject/. Then install packages there with pip install. When you are done, run deactivate.
I keep all my projects under ~/projects/ with one virtual environment per project. This avoids dependency conflicts, which are the main reason people end up frustrated with Python on Linux.
Common Pitfall I Have Encountered
Last year I was setting up a development environment on a fresh Linux Mint 22 install for a Django project that required Python 3.12. I followed the deadsnakes steps above, created the virtual environment, and when I tried to install psycopg2-binary, the build failed because it could not find libpq-dev. The error was not obvious at first because pip does not always tell you directly that a missing system library is the cause. The fix was simple but not immediately clear if you do not know what you are looking for: sudo apt install libpq-dev

After that, pip install psycopg2-binary worked without issues. I now run that system library installation as part of my initial Mint setup checklist, along with build-essential, libffi-dev, and libssl-dev, because these come up repeatedly across different projects.
Alternative: pyenv
If you need to switch between multiple Python versions frequently, deadsnakes gets cumbersome. The alternative I use for that scenario is pyenv. It installs Python versions into your home directory without touching the system Python at all. The installation process: curl https://pyenv.run | bash
Then add these lines to your ~/.bashrc: export PYENV_ROOT="$HOME/.pyenv" export PATH="$PYENV_ROOT/bin:$PATH"

eval "$(pyenv init -)" After restarting your terminal or running source ~/.bashrc, you can install versions: pyenv install 3.12.4
pyenv global 3.12.4 This method is slower because it compiles Python from source, and you will need build dependencies. Run sudo apt install build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev libffi-dev before attempting a pyenv install. If you skip those, the build will fail halfway through and you will waste time debugging it. pyenv is more work upfront but saves significant time once you are managing three or more projects with different Python requirements.>
What This Method Does Not Fix
These instructions assume a standard desktop or server install of Linux Mint. If you are running Mint in a minimal container or a custom environment where basic tools like curl or git are missing, you will need to handle that first. The guide assumes you have a working APT configuration and network access. It also does not address GPU-accelerated Python workloads, which require NVIDIA driver setup separate from Python installation.
If your goal is data science with heavy numerical computing, consider whether conda or mamba might serve you better than pip and virtual environments. Those tools manage their own Python installations and dependency resolution differently, and they handle binary packages better for certain scientific libraries. For general purpose development, the deadsnakes approach described here is the most reliable path I have found on Linux Mint.