pip is a python package manager that allows you to install, upgrade and remove pip packages on Arch Linux, and any other linux distro.
pip is not installed by default on Arch Linux, meaning Arch Linux doesn't have pip installed by default on it. So to be able to use pip on Arch Linux, you need to install pip on your machine.
There are different ways to install pip on Arch Linux. One way of installing pip on Arch Linux, which is also the fastest ways, is by using pacman to install the
python-pip package that is available on AUR repository.
Another way of installing pip on Arch Linux, is by using the official installer which is a python script that you need to download and execute it on your machine.
This script downloads pip package on your system, and then installs it.
In this tutorial, you will learn how to install pip on Arch Linux, by using pacman and by using the official pip's installer.
Install pip via Pacman on Arch Linux
To install pip using pacman from your terminal, is very simple. All you have to do is, run the installation command on pacman just like you would do for a package.
So to download and install pip on Arch Linux, you can do so by running the command below
sudo pacman -S python-pip
Install pip via official installer on Arch Linux
Alternatively, you can install pip via the official installer that pip provides.
1 ) First you need to download the installer on your machine
wget -q https://bootstrap.pypa.io/get-pip.py
2) Run the installer
get-pip.py to begin installing pip
Note: If you get the following error on your terminal
error: externally-managed-environment × This environment is externally managed ╰─> To install Python packages system-wide, try 'pacman -S python-xyz', where xyz is the package you are trying to install. If you wish to install a non-Arch-packaged Python package, create a virtual environment using 'python -m venv path/to/venv'. Then use path/to/venv/bin/python and path/to/venv/bin/pip. If you wish to install a non-Arch packaged Python application, it may be easiest to use 'pipx install xyz', which will manage a virtual environment for you. Make sure you have python-pipx installed via pacman. note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. hint: See PEP 668 for the detailed specification.
You need to delete the EXTERNALLY-MANAGED File to be able to install pip, to delete this file, simply run the command below
sudo rm -rf /usr/lib/python3.11/EXTERNALLY-MANAGED
Once deleted, run the installer again, and you should be able to install pip now.
4) Once pip is installed on your system, add pip to PATH so that you are able to use pip.
Note: Make sure to replace
/home/owlhowto/.local/bin with your path
Verify pip installation
Now you need to verify that pip was installed correctly. To do so, you can check the version that you installed
Uninstall pip on Arch Linux
If you installed pip via pacman, then you can easily uninstall it by using pacman.
sudo pacman -R python-pip
If you installed pip using the official pip installer, then to uninstall pip you can do so by running the command below
pip uninstall pip
In this tutorial, you learned how to install pip on Arch Linux, via two different ways. By using pacman, and by using the official pip's installer.