我是 python 新手,建议我使用 Canopy。我正在尝试跟随with this tutorial ,但我陷入了 mahotas.imread 行。我收到一条错误消息,指出此内容结束:
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'
我已经通过包管理器添加了 mahotas 包,但没有效果。还尝试了步骤here ,没有不同的结果。
我实际上能够在“/Users/RJD/Library/Enthought/Canopy_32bit/User/lib/python2.7/site-packages/mahotas”中找到“freeimage.py”和“freeimage.pyc”。我该如何告诉 Canopy 它在那里?!
任何帮助将不胜感激。
干杯,
最佳答案
这里是 mahotas 的作者:
Mahotas 本身不具备读取图像的功能。 imread
只是 3 个后端之一的包装器:
- mahotas-imread(即 https://pypi.python.org/pypi/imread )
- FreeImage(这是原始版本,如果您有这么旧的版本 [0.7.1 是 12 年 1 月的版本],它可能仍然只支持 FreeImage)
- matplotlib(仅支持 PNG 和 JPEG)
因此,您需要安装上面的软件包之一。
关于认为 mahotas.imread 找不到 freeimage,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18296113/