OSX Pillow不兼容的库版本libtiff.5.dylib和libjpeg.8.dylib

Ant*_*nio 5 python macos pillow

尝试在任何脚本上使用Pilow时出现此错误:

  File "/Users/antonio/WWW/myproj/myproj/functions.py", line 12, in <module>
    from PIL import Image, ImageOps
  File "/Library/Python/2.7/site-packages/PIL/Image.py", line 53, in <module>
    from PIL import _imaging as core
ImportError: dlopen(/Library/Python/2.7/site-packages/PIL/_imaging.so, 2): Library not loaded: /usr/local/lib/libjpeg.8.dylib
  Referenced from: /usr/local/lib/libtiff.5.dylib
  Reason: Incompatible library version: libtiff.5.dylib requires version 13.0.0 or later, but libjpeg.8.dylib provides version 9.0.0
Run Code Online (Sandbox Code Playgroud)

谁能帮我?

Epo*_*pok 5

我有同样的问题,我不得不重新安装枕头,所有都是依赖.我的一些符号链接哪里不好.

首先,你必须:

brew doctor
Run Code Online (Sandbox Code Playgroud)

看看你是否有一些错误.我是这样的:

Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
/usr/local/lib/libjpeg.8.dylib
/usr/local/lib/libpng.3.dylib
/usr/local/lib/libpng12.0.dylib
/usr/local/lib/libpng14.14.dylib

Warning: Unbrewed .la files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .la files:
/usr/local/lib/libjpeg.la
/usr/local/lib/libpng12.la
/usr/local/lib/libpng14.la
/usr/local/lib/libpng15.la

Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

 Unexpected .pc files:
/usr/local/lib/pkgconfig/libpng12.pc
/usr/local/lib/pkgconfig/libpng14.pc

Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected static libraries:
/usr/local/lib/libjpeg.a
/usr/local/lib/libpng12.a
/usr/local/lib/libpng14.a
Run Code Online (Sandbox Code Playgroud)

所以我决定清除我安装的所有错误和依赖项:

brew uninstall pillow
brew uninstall libpng
brew uninstall libjpeg
brew uninstall webp
brew uninstall libtiff
brew uninstall littlecms

brew prune => to clean symlink
Run Code Online (Sandbox Code Playgroud)

当我的酿酒医生没有任何错误时,我就跑了brew install pillow,一切都很好.

希望它有所帮助.


Fra*_*ank 5

尝试重新安装最新版本的枕头。我使用 anaconda python,并且

conda install -f pillow
Run Code Online (Sandbox Code Playgroud)

为我解决类似的问题。

  • 这不是一个好的答案。使用“pip install”对我有用,但如果系统其他地方的库存在问题,则使用 pip 或 conda 将不起作用 (2认同)