简体   繁体   English

我安装了 Pillow,但我得到“ModuleNotFoundError: No module named 'PIL'”

[英]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.

相关问题 进口枕头,但我仍然得到“没有名为PIL的模块” - Imported Pillow But I Still Get “No Module Named PIL” ModuleNotFoundError: 没有名为“枕头”的模块 - ModuleNotFoundError: No module named 'Pillow' 我收到错误:ModuleNotFoundError: No module named 'PIL' - I am getting the error : ModuleNotFoundError: No module named 'PIL' Pillow 已安装,但仍然收到“ImportError: No module named PIL” - Pillow is installed, but still getting “ImportError: No module named PIL” 安装了枕头,但仍收到“ ImportError:无名为PIL的模块” - Have pillow installed and yet getting 'ImportError: No module named PIL' 我安装了一个名为 Discord 的模块,在使用“import discord”时出现错误:“ModuleNotFoundError: No module named 'discord'” - I Installed a Module Called Discord and When Using “import discord” I Get the Error: “ModuleNotFoundError: No module named 'discord'” ModuleNotFoundError: 没有名为“unidecode”的模块,但我已经安装了该模块 - ModuleNotFoundError: No module named 'unidecode' yet I have the module installed 我收到此错误(ModuleNotFoundError: No module named 'pandas'),即使我安装了它 - I get this error ( ModuleNotFoundError: No module named 'pandas' ) even though i installed it 我收到以下错误:ModuleNotFoundError:未命名模块 - I get the following error: ModuleNotFoundError: No module named ModuleNotFoundError: No module named 'rest_framework' 我已经安装了 djangorestframework - ModuleNotFoundError: No module named 'rest_framework' I already installed djangorestframework
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM