Python 错误 ImportError: cannot import name 'VERSION'

2017-11-26 21:23:29 +08:00
 mingyun

win7 py3

>>> from PIL import Image
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\python3\lib\site-packages\PIL\Image.py", line 27, in <module>
    from . import VERSION, PILLOW_VERSION, _plugins
ImportError: cannot import name 'VERSION'
>>> import PIL#这个能导入的
>>> dir(PIL)
['__doc__', '__loader__', '__name__', '__package__', '__path__', '__spec__']
4954 次点击
所在节点    Python
1 条回复
mingyun
2017-11-26 21:49:07 +08:00
解决了
$ pip install -U pillow
Collecting pillow
Using cached Pillow-4.3.0-cp35-cp35m-win32.whl
Requirement already up-to-date: olefile in d:\python3\lib\site-packages (from pi
llow)
Installing collected packages: pillow
Found existing installation: Pillow 4.2.1
Uninstalling Pillow-4.2.1:
Successfully uninstalled Pillow-4.2.1
Successfully installed pillow-4.3.0

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/409716

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX