Python: No module named ... How to use pip

pip is python's packet manager. It's shipped by default with python since version 3.4, so you should probably use it.

Usually for now, python on linux redirects to python2.7 and there is kind of a problem with upgrading to python3.x because of some old linux tools.

So you'll probably have both python2.7 and python3.x on your OS at some point.

If you aren't sure if you have pip for the version of python you want to use install it :

cd /tmp
wget https://bootstrap.pypa.io/get-pip.py
python3.4 get-pip.py # install pip for any python -v (3.4 here but replace with yours)
rm get-pip.py -f

Now pip is installed, and you can use it to search / install / upgrade / remove / ... python packets.

So let's install joblib :

python3.4 -m pip install joblib # install packets for a particular version easily

As you can see I don't use pip install but python3.x -m pip install so pip installs the libraries for that specific version of python.


For me I had the wrong version of joblib installed. Reintalling sklearn and joblib solved the issue.

pip uninstall sklearn
pip uninstall joblib

pip install sklearn
pip install joblib

Tags:

Python