在python中使用mahotas和imread包

时间:2014-11-24 16:04:44

标签: python mahotas imread

我对使用Mahotas软件包进行python感兴趣,不幸的是我在安装或运行它时遇到了一些问题。我跑的时候:

sudo pip install mahotas

我明白了:

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...

所以我认为它安装正确。尝试从文档中复制simple example时,我收到以下消息:

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'

由于我在Mac上工作,我按照建议运行:

sudo port install libpng tiff webp
sudo pip install imread

给了我:

--->  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.

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

所以对我来说,似乎我安装了imread就像错误消息告诉我的那样。但是我一直得到同样的信息..

有谁知道如何解决这个问题?非常感谢所有帮助!

0 个答案:

没有答案