V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
mingyun
V2EX  ›  Python

Python 错误 ImportError: cannot import name 'VERSION'

  •  
  •   mingyun · 2017-11-26 21:23:29 +08:00 · 4941 次点击
    这是一个创建于 2340 天前的主题,其中的信息可能已经有所发展或是发生改变。

    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__']
    
    mingyun
        1
    mingyun  
    OP
       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
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3701 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 04:25 · PVG 12:25 · LAX 21:25 · JFK 00:25
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.