enthought mahotas.imread cannot find freeimage

514 views Asked by At

I'm new to python and it was recommended that I use Canopy. I'm trying to follow along with this tutorial, but I get stuck at the mahotas.imread line. I get an error saying that ends with this:

Full error was: mahotas.freeimage: could not find libFreeImage in any of the following directories: '/Users/RJD/Library/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/mahotas', '/lib', '/usr/lib', '/usr/local/lib', '/opt/local/lib'

I've added the mahotas package via the package manager to no avail. Also tried the steps here, with no different result.

I am actually able to find 'freeimage.py' and 'freeimage.pyc' in '/Users/RJD/Library/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/mahotas'. How do I go about telling Canopy that it is there?!

Any help would be very much appreciated.

Cheers, R

2

There are 2 answers

0
Jonathan March On

To be clear, there is no "enthought mahotas". Mahotas is not in the Enthought package repository but in our "Community" (PyPi mirror) repo of 11,000 untested ("as is") packages, as you can see by the "PyPI" logo in the Package Manager (sorry, that's not at all obvious, we'll fix this!) We will be updating this repo later this year. The version of mahotas in that PyPI repo is 0.7.1, whereas the current version of mahotas on PyPI is 1.0.2. So that avenue is not useful for now.

When you say that you tried the steps in the cmu.edu document, was that after uninstalling the old PyPI version just mentioned and going through each step mentioned in that document?

0
luispedro On

Author of mahotas here:

Mahotas itself does not have the functionality to read in images. imread is just a wrapper around one of 3 backends:

  1. mahotas-imread (i.e., https://pypi.python.org/pypi/imread)
  2. FreeImage (this was the original version and if you have such an old version [0.7.1 is from Jan '12], it might still only support FreeImage)
  3. matplotlib (which only supports PNG & JPEG)

Thus, you need to install one of the packages above.