M HYPE SPLASH
// updates

Pip not included in Python3.6 on CentOS 7?

By Emma Payne

When running which python3.6, I get /usr/bin/python3.6.

But when I try python3.6 -mpip install matplotlib, it says /usr/bin/python3.6: No module named pip.

I was informed that pip SHOULD be included in Python 3.4 and above. But why don't I have pip for Python 3.6? And how can I use it/get it?

2 Answers

You need to install the python-pip package and the development tools:

yum install python-pip python-devel
yum groupinstall 'development tools'

If the python-pip package is not available or you need a later version - you could install the EPEL repository first, and then install the python-pip package

yum install epel-release

To install the lib

pip install matplotlib

Note: If I remember correctly, yum the package manager is a python app, too. Be careful with updating packages (pip install -U <package>) with pip since it might break yum.

There are virtual environments (virtualenv) for python development which is isolating your development python environment from the one on your system.

sudo apt-get install python3-pip

you can also do this so you don't need to specify python3 (though it may potentially break something that explicitly wants 2.7): alias python=python3

You are also missing a space: python3.6 -m pip install matplotlib

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy