What is Pip?
Pip is a package management system to install and manage software packages written in Python. As Pip is not installed on CentOS 7 by default, you have to install it manually. Python language follows a design philosophy that emphasizes code readability which makes it one of the easiest programming languages to learn.
Python is an open source and runs on various platforms such as Linux/UNIX distributions (CentOS, Ubuntu, Fedora, Debian, etc.), Microsoft Windows, and Mac OS X.
You can install python modules using yum or pip. When you want to install python modules globally, you can use yum as they are tested to work properly on CentOS 7. Use pip to install python packages if there is no rpm package for the python module.
It is always recommended to use pip inside a virtual environment only. This permits you to install Python modules in an isolated location for a specific project instead of being installed globally. Therefore, your other Python projects won’t be affected.
Learn on how to install Pip on WIndows
Prerequisites
- A working CentOS 7 server.
- Logged in as a root user or
- Logged in as a user with sudo privileges.
Installing pip on CentOS 7
Follow the given steps to install python pip on CentOS 7:
1. Add the EPEL Repository
To install pip you have to enable the EPEL repository as it is not available in CentOS 7 core repositories
yum install epel-release
2. Install Pip
Before installing pip you have to update your packages.
yum -y update
After that begin with the process of python-pip installation
yum -y install python-pip
3. Verify Pip installation
After successful installation, it is important to check if the pip is installed correctly or not. It can be done by running a command which will print the pip version:
pip –version
The output may vary, but it should appear something like this:-
pip 8.1.2 from /usr/lib/python2.7/site-packages (python 2.7)
4. Install Development tools
You can install development tools to build python modules using following
Development tools are required for building Python modules, you can install them with:
yum install python-devel
yum groupinstall ‘development tools’
List of helpful commands:-
To install a package. Fo example, if you want to install pygraphy
pip install pygraphy
To uninstall a package run:
pip uninstall pygraphy
To search packages from PyPI:
pip search “pygraphy”
List installed packages:
pip list
To list outdated packages:
pip list –outdated
You may also find this useful:- Install Python on Windows
Have other thoughts or questions? Reach out to us, our expert support is available 24*7 by phone or mail.
You can also open a chat with us and we’ll be happy to answer any questions you may have!