The error reported by python in the python guide package is as follows

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
>>>

Why is this, uh,

Dec.05,2021

check whether the running python environment is consistent with the running environment of shell. I have encountered that the python3 of the console is not the same as the python3 started under the actual running directory, which leads to the import of the imported package. You can use

in two environments.
pip3 list

statement to see if PIL exists, compare it with

Menu