What is pip?
Python is a programming language. Many websites and tools are written in it. Pip is a helper program for Python. It downloads and installs add-on code, called packages, for you. Think of it as an app store that works from the command line.
The command line is a screen where you type commands instead of clicking. On a server, you reach it with an SSH client. SSH is a safe way to control a server from far away.
Before you start
- You need root access, or a user that can use
sudo. Sudo means "run this as the boss user". - You need to log in to your server with SSH. Your welcome email has the login details. You can also ask Hostvento support.
Steps
- Log in to your server with SSH.
- Update the list of available software:
This command refreshes the list of packages that Ubuntu can install.sudo apt-get update - Install pip for Python 3:
This command downloads pip and sets it up. Typesudo apt-get install python3-pipyand press Enter if it asks you to confirm. - If you want pip for Python 2, run this instead:
sudo apt-get install python-pip - Check that pip is installed:
This command prints the pip version number. If you see a number, pip works.pip3 --version
Install your first package
Try a small package to test pip. This one is called requests. It helps Python programs talk to websites.
pip3 install requests
This command downloads the package. To remove it later, run pip3 uninstall requests.
Common problems
- Command not found: Run the update command again, then retry the install step.
- Permission denied: Add
sudoat the start of the command. - Old pip warning: Pip may say a newer version exists. You can ignore it for basic use.
Quick recap
- Pip installs Python packages for you.
- Log in with SSH and run
sudo apt-get update. - Install it with
sudo apt-get install python3-pip. - Check it with
pip3 --version. - Ask Hostvento support if you cannot reach your server.