

To execute Python 2, type python2, and to run pip type pip2.

The output should look something like this: Python 2.7.15 Verify the installation by typing: pip2 -version To install Python 2 and pip, enter the following command: sudo dnf install python2 To be able to install and build Python modules with pip, you need to install the Development tools: sudo yum install python3-devel sudo yum groupinstall 'development tools' Installing pip for Python 2 (pip2) # The version number may vary, but it will should something like this: pip 9.0.3 from /usr/lib/python3.6/site-packages (python 3.6) Verify that the pip is installed correctly by running the following command which will print the pip version: pip3 -version To run Python 3, you need to type python3 explicitly, and to run pip type pip3. In your terminal: sudo dnf install python3 To install pip for Python 3 on CentOS 8 run the following command as root or sudo user Module for Python 3, you would run: sudo dnf install python3-paramiko Installing pip for Python 3 (pip3) #

The names of the Python 2 module packages are prefixed with “python2” and Python 3 modules with “python3”.

Use pip to install python modules globally only if there is no rpm package When installing python modules globally, you should prefer installing python modules from the distribution repositories using dnf or yum because they are tested to work properly on CentOS 8. Instead, it gives the user a choice to install, configure, and run a specific Python version By default RHEL/CentOS 8 doesn’t have an unversioned system-wide python command to avoid locking the users to a specific version of Python. Installing pip on CentOS 8 #Īs you know, there are two Python versions that are being actively developed, Python 2 and Python 3. In this tutorial, we will explain how to install pip for Python 2 and 3 on CentOS 8 and cover the basics of how to manage Python packages with pip.
