Ubuntu 26.04 ships Python 3.14 in its default APT repository, making it available without any external sources or version management overhead. This guide covers installing Python and pip, verifying the interpreter, and setting up virtual environments to keep project dependencies isolated from the system installation and from each other.
Install Python
Python 3.14 is available directly from Ubuntu 26.04's default APT repository.
1. Update the APT package index:
$ sudo apt update
2. Install Python:
$ sudo apt install python3 -y
3. Verify the installed version:
$ python3 --version
Install pip
pip is the standard package manager for Python, used to install and manage packages from the Python Package Index.
1. Install pip:
$ sudo apt install python3-pip -y
2. Verify the installed version:
$ pip3 --version
Test the Python Interpreter
The interactive shell confirms the interpreter is installed and responding correctly.
$ python3
>>> print("Hello, Python!")
Hello, Python!
>>> import sys; print(sys.version)
>>> exit()
Create a Virtual Environment
Virtual environments provide isolated Python installations where each project maintains its own set of dependencies, preventing version conflicts across projects and protecting the system Python installation.
1. Install the venv module:
$ sudo apt install python3-venv -y
2. Create a new virtual environment:
$ python3 -m venv example_env
3. Activate the environment:
$ source example_env/bin/activate
The prompt changes to (example_env) to indicate the environment is active.
4. Install a package inside the environment:
$ pip install requests
5. List installed packages:
$ pip list
6. Deactivate the environment:
$ deactivate
The requests package remains scoped to example_env and does not affect any other project or the system Python installation.
Next Steps
Python and pip are now installed and ready for development. From here you can:
- Use
pipxto install CLI tools in isolated environments without affecting project dependencies - Try
uvfor faster package management and built-in virtual environment support - Set up a Jupyter Notebook server for interactive data science and analysis workflows
For the complete guide, visit the original article on Vultr Docs.
Top comments (0)