Using mahotas and imread package in python

1.7k views Asked by At

Im interested in using the Mahotas package for python, unfortunately i'm experiencing some problems installing or running it. When I run:

sudo pip install mahotas

I get:

Requirement already satisfied (use --upgrade to upgrade): mahotas in ./anaconda/lib/python2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): numpy in ./anaconda/lib/python2.7/site-packages (from mahotas)
Cleaning up...

So I assume its installed correctly. When trying to duplicate a simple example from the documentation however I get the following message:

ImportError: 
mahotas.imread depends on one of (in order of preference):

1. imread
2. freeimage

None of which could be found!

Everything else will work, though, so this error is only triggered when you
attempt to use these optional functions.

To install imread:

On **Ubuntu**, run the following commands::

    sudo apt-get install libpng12-dev libtiff4-dev libwebp-dev python-pip python-dev g++
    sudo pip install imread

On **Mac OS**, if using ``port``, run the following commands::

    sudo port install libpng tiff webp
    sudo pip install imread

On **Windows**, use Christoph Gohlke's packages. See:

http://www.lfd.uci.edu/~gohlke/pythonlibs/#imread




To install FreeImage:

You need to have the freeimage installed for imread/imsave (everything else
will work, though, so this error is only triggered when you attempt to use
these optional functions). Freeimage is not a Python package, but a regular
package.

Under Linux, look for a package called `freeimage` in your distribution (it is
actually called `libfreeimage3` in debian/ubuntu, for example).

Under Windows, consider using the third-party mahotas packages at
http://www.lfd.uci.edu/~gohlke/pythonlibs/ (kindly maintained by Christoph
Gohlke), which already package freeimage.

Full error was: mahotas.freeimage: could not find libFreeImage in any of thefollowing directories: '/Users/hmcoerver/anaconda/lib/python2.7/site-packages/mahotas/io', '/lib', '/usr/lib', '/usr/local/lib', '/opt/local/lib'

Since im working on a Mac, i run as suggested:

sudo port install libpng tiff webp
sudo pip install imread

which gives me:

--->  Computing dependencies for libpng
--->  Cleaning libpng
--->  Computing dependencies for tiff
--->  Cleaning tiff
--->  Computing dependencies for webp
--->  Cleaning webp
--->  Scanning binaries for linking errors
--->  No broken files found.

and

Requirement already satisfied (use --upgrade to upgrade): imread in ./anaconda/lib/python2.7/site-packages
Cleaning up...

So to me, it seems like I installed imread like the error message told me to. But I keep getting the same message however..

Does anyone have a idea how to solve this? All help is very much appreciated!

0

There are 0 answers