我已成功在macbook上安装了python 3枕头。但我仍然无法使用PIL库。我尝试再次卸载并安装它。我也尝试了import Image
而没有from PIL
。但是,我没有安装PIL。它说
无法找到满足要求PIL的版本(来自 版本:)
from PIL import Image
--------------------------------------------------------------------------- ImportError Traceback (most recent call last) <ipython-input-4-b7f01c2f8cfe> in <module>()
----> 1 from PIL import Image
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/PIL/Image.py in <module>()
58 # Also note that Image.core is not a publicly documented interface,
59 # and should be considered private and subject to change.
---> 60 from . import _imaging as core
61 if PILLOW_VERSION != getattr(core, 'PILLOW_VERSION', None):
62 raise ImportError("The _imaging extension was built for another "
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/PIL/_imaging.cpython-36m-darwin.so, 2): Symbol not found: _clock_gettime Referenced from: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/PIL/.dylibs/liblzma.5.dylib (which was built for Mac OS X 10.12) Expected in: /usr/lib/libSystem.B.dylib in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/PIL/.dylibs/liblzma.5.dylib
答案 0 :(得分:1)
如果您使用Anaconda
,可以尝试:
conda install Pillow
因为这适合我。
答案 1 :(得分:0)