Last modified: Sep 28, 2026
Install Python on Arch Linux with Pacman
Arch Linux is famous for its speed and simplicity. It gives you full control over your system. That is why many developers love it.
Python is one of the most popular programming languages today. You need it for web development, automation, data science, and more. Installing Python on Arch is quick and easy.
This guide shows you how to install Python with pacman. You will also learn how to set up pip, virtual environments, and fix common problems.
Why Use Pacman for Python?
Pacman is the default package manager for Arch Linux. It handles installation, updates, and removal of software. It is fast and reliable.
Using pacman keeps Python updated with your system. It also avoids conflicts with other packages. This is safer than downloading Python from the official website.
The Arch repositories always have the latest stable Python version. You do not need to compile anything from source.
Step 1: Update Your System
Before installing anything, update your package database. This ensures you get the newest versions.
sudo pacman -Syu
This command refreshes the package lists and upgrades all installed packages. Always do this first to avoid version mismatches.
Step 2: Install Python
Now install Python with a single command. The package name is simply python.
sudo pacman -S python
Pacman will ask for confirmation. Press Enter to proceed. It will download and install Python and its dependencies.
After installation, check the version:
python --version
You should see output like this:
Python 3.12.3
The exact version may differ. That is fine. You now have a working Python installation.
Step 3: Install pip
pip is the package installer for Python. You need it to install third-party libraries like requests or numpy.
On Arch, pip is included in the python-pip package. Install it like this:
sudo pacman -S python-pip
Verify pip is working:
pip --version
Expected output:
pip 24.0 from /usr/lib/python3.12/site-packages/pip (python 3.12)
Now you can install any Python package from PyPI.
Step 4: Set Up a Virtual Environment
A virtual environment isolates your project dependencies. This prevents conflicts between projects. It is a best practice for all Python work.
Arch includes the python-virtualenv package. But you can also use the built-in venv module. Let us use venv since it comes with Python.
Create a new directory for your project and enter it:
mkdir myproject
cd myproject
Now create the virtual environment:
python -m venv venv
This creates a folder named venv with a copy of Python and pip. Activate it with this command:
source venv/bin/activate
Your prompt will change to show the environment name. For example:
(venv) user@arch ~/myproject $
Now any package you install with pip stays inside this environment. To leave it, type deactivate.
Step 5: Test Your Installation
Let us write a simple Python script to confirm everything works. Create a file called hello.py:
# hello.py
# A simple test script
print("Hello, Arch Linux!")
Run it with Python:
python hello.py
You should see:
Hello, Arch Linux!
Congratulations. Python is fully working on your Arch system.
Common Issues and Fixes
Command Not Found: python
If you see bash: python: command not found, the package did not install. Run the install command again. Also check your PATH variable.
Externally Managed Environment Error
Recent Python versions block pip installs outside a virtual environment. You may see this error:
error: externally-managed-environment
This is a safety feature. The fix is simple. Always use a virtual environment as shown above. Do not use --break-system-packages unless you know what you are doing.
Permission Denied
If pip fails with permission errors, you are likely installing globally. Use a virtual environment instead. Never use sudo pip on Arch. It can break your system.
Keeping Python Updated
Update Python along with your system. Run this command regularly:
sudo pacman -Syu
Pacman handles Python updates automatically. Your virtual environments stay independent. You may need to recreate them after a major Python version change.
Conclusion
Installing Python on Arch Linux is straightforward with pacman. You run two commands for Python and pip. Then you create a virtual environment for each project.
This approach keeps your system clean and your projects isolated. It follows Arch best practices. You avoid dependency conflicts and permission problems.
Now you are ready to build with Python on Arch. Start a new project, activate your venv, and write some code. Happy coding.