import PIL
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Applications/PyCharm.app/Contents/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 19, in do_import
module = self._system_import(name, *args, **kwargs)
ImportError: No module named PIL
在shell 里面没有报错
➜ ~ python3
Python 3.6.5 (default, Apr 25 2018, 14:26:36)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import PIL
>>>
这是为啥额
查看一下运行的python环境和shell的运行环境是否一致,我就遇到过控制台的python3和实际运行目录下启动的python3不是同一个,然后导致导入的包漏导入。你可以在两个环境下,用
语句看看PIL是否存在,对比一下