Installing Python modules even when they don’t behave… e.g. installing Scikit-image on Ubuntu 16.04

Usually when you are missing any Python library you happen to want to use, you can install it in Python and have it accessible from your scripts or terminal, simply by using:

pip install <name of package>

Or, more appropriately if you are not on an ancient script and you are using Python3…

pip3 install <name of package>

But what if you run into issues? Earlier I was trying scikit-image which had gone since the last major Ubuntu upgrade, and ran into a problem:

    Complete output from command python setup.py egg_info:
    
    Beginning with Matplotlib 3.1, Python 3.6 or above is required.
    
    This may be due to an out of date pip.
    
    Make sure you have pip >= 9.0.1.
    
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-pf9iywqi/matplotlib/

While Matplotlib was already installed, this is problematic because the built in version of Python in Ubuntu 16.04’s official packages is 3.5-based. It would seem ridiculous to upgrade the system packages for one library that you may use, but there is a workaround. This was working in previous Ubuntu version, so let’s find what version may work…

Try a few of those old versions, and you should eventually get to the one that works:

pip3 install scikit-image==0.12.3

Now enjoy your working Scikit-image on Ubuntu 16.04 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

53 − fifty one =