ImportError: from . import _imaging as core
【摘要】 报错现象
from PIL import Image
import numpy as np
img = Image.open("images/bigsea.jpg")
print(img)12345
部分报错信息:
Traceback (most recent call last): from PIL import Image from . import _im...
报错现象
from PIL import Image
import numpy as np
img = Image.open("images/bigsea.jpg")
print(img)
- 1
- 2
- 3
- 4
- 5
部分报错信息:
Traceback (most recent call last): from PIL import Image from . import _imaging as core
ImportError: dlopen(/Users/.virtualenvs/py3/lib/python3.6/site-packages/PIL/_imaging.cpython-36m-darwin.so, 2): Symbol not found: _clock_gettime
Referenced from: /Users/.virtualenvs/py3/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 /Users/.virtualenvs/py3/lib/python3.6/site-packages/PIL/.dylibs/liblzma.5.dylib
- 1
- 2
- 3
- 4
- 5
- 6
- 7
解决问题
python版本:Python 3.6.5
pillow版本: 5.1.0
看到网上有人有类似的错误
python3 openCV install error: Symbol not found: _clock_gettime
下面有人回答:
If you don't want to upgrade your OS, you can install an earlier version of opencv:
- 1
大致意思是:升级你的操作系统,或者安装更早版本
当然,我选择了后者
去pypi上看下pillow的版本
https://pypi.org/project/Pillow/#history
卸载掉pillow,重新安装
pip install pillow==4.0.0
- 1
问题解决!
原来是pillow版本的问题,安装早期版本就解决了
文章来源: pengshiyu.blog.csdn.net,作者:彭世瑜,版权归原作者所有,如需转载,请联系作者。
原文链接:pengshiyu.blog.csdn.net/article/details/80217854
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)