This guide explains how to install pip, the package manager for Python, using the curl method.
- Python 3 installed on your system
- Internet access
- Terminal or command line
-
Download the pip installation script:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
This command downloads the
get-pip.py
script from the official PyPA (Python Packaging Authority) website and saves it in your current directory. -
Run the script with Python:
python3 get-pip.py
This command runs the downloaded script, which will install pip on your system.
We use the curl
command to download files from the internet. In this case:
https://bootstrap.pypa.io/get-pip.py
is the URL of the pip installation script.-o get-pip.py
tells curl to save the downloaded file asget-pip.py
in the current directory.
python3 get-pip.py
starts the Python 3 interpreter and runs the get-pip.py
script. This script:
- Checks your Python environment
- Downloads the latest version of pip
- Installs pip on your system
After installation, you can check if pip is correctly installed by running:
pip --version
This should display the version of pip installed on your system.
If you encounter permission errors during installation, you may need to run the command with sudo
:
sudo python3 get-pip.py
Make sure to keep pip up to date by regularly using the command:
pip install --upgrade pip