我使用:
安装了PIL / Pilloweasy_install pillow
然后导入库:
from PIL import ImageGrab, Image
但现在我收到以下错误:
> Traceback (most recent call last): File
> "C:/temp/main.py", line 1, in <module>
> from bot import Bot File "C:/temp/main.py", line 1, in <module>
> from PIL import ImageGrab, Image File "C:\Python34\lib\site-packages\pillow-4.1.1-py3.4-win-amd64.egg\PIL\ImageGrab.py",
> line 18, in <module> File
> "C:\Python34\lib\site-packages\pillow-4.1.1-py3.4-win-amd64.egg\PIL\Image.py",
> line 56, in <module> File
> "C:\Python34\lib\site-packages\pillow-4.1.1-py3.4-win-amd64.egg\PIL\_imaging.py",
> line 7, in <module> File
> "C:\Python34\lib\site-packages\pillow-4.1.1-py3.4-win-amd64.egg\PIL\_imaging.py",
> line 3, in __bootstrap__ File
> "C:\Python34\lib\site-packages\pkg_resources.py", line 21, in <module>
> import imp File "C:\Python34\lib\imp.py", line 22, in <module>
> from importlib import util File "C:\Python34\lib\importlib\util.py", line 12, in <module>
> from contextlib import contextmanager File "C:\Python34\lib\contextlib.py", line 5, in <module>
> from functools import wraps File "C:\Python34\lib\functools.py", line 22, in <module>
> from types import MappingProxyType, MethodType ImportError: cannot import name 'MappingProxyType'
我在不同的计算机上获得相同的行为