gpt4 book ai didi

python - 无法导入PIL库

转载 作者:行者123 更新时间:2023-12-01 09:28:18 25 4
gpt4 key购买 nike

我已经在我的 MacBook 上成功安装了 python 3 的枕头。但我仍然无法使用PIL库。我尝试卸载并重新安装。我也尝试过在没有 from PIL 的情况下导入图像。不过我没有安装 PIL。它说

Could not find a version that satisfies the requirement PIL (from versions: )

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

最佳答案

如果您使用Anaconda,您可以尝试:

conda install Pillow

因为这对我有用。

关于python - 无法导入PIL库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50182828/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com