[英]I installed Pillow but i get “ModuleNotFoundError: No module named 'PIL'”
When I try to use from PIL import ImageGrab
it gives me this error:当我尝试使用
from PIL import ImageGrab
时,它给了我这个错误:
ModuleNotFoundError: No module named 'PIL'
I installed it with pip install pillow
and checked if it is installed with pip show pillow
.我用
pip install pillow
安装它,并检查它是否安装了pip show pillow
。 It says I have Version: 8.1.2它说我有版本:8.1.2
I am using python 3.9 and sublime text 3我正在使用python 3.9和 sublime text 3
In the internet I saw most people with that problem have a not maching python version with the pillow version, but mine should work as far as I understood..?在互联网上,我看到大多数有这个问题的人都有一个与枕头版本不匹配的 python 版本,但据我所知,我的应该可以工作..? ( https://pillow.readthedocs.io/en/stable/installation.html )
( https://pillow.readthedocs.io/en/stable/installation.html )
However its not working and I am trying to fix this since about two hours and I hope somebody can help me.但是它不起作用,我试图解决这个问题大约两个小时,我希望有人可以帮助我。
You might have different versions of python installed and pip is installing pillow for a different version.您可能安装了不同版本的 python 并且 pip 正在为不同版本安装枕头。
A good way to avoid this is using python -m pip install pillow
instead of pip install pillow
.避免这种情况的一个好方法是使用
python -m pip install pillow
而不是pip install pillow
。
Try to install it with pip3 install pillow
尝试使用
pip3 install pillow
安装它
The fact is that you installed it for python2 but your are using python3;)事实是您为 python2 安装了它,但您使用的是 python3;)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.