简体   繁体   English

我安装了 Pillow 并尝试使用 from PIL import Image 但它给出了错误

[英]I installed Pillow and am trying to use from PIL import Image but it gives an error

I have installed Pillow (7.2.0) but when I use我已经安装 Pillow (7.2.0) 但是当我使用

from PIL import ImageTk, Image, ImageDraw, ImageFont

it gives me this error: ModuleNotFoundError: No module named 'PIL'它给了我这个错误: ModuleNotFoundError: No module named 'PIL'

What can I do?我能做什么? I did pip install Pillow .我做了pip install Pillow I've tried uninstalling and installing pillow but it did not work.我试过卸载和安装枕头,但没有用。 I am on windows and have python 3.7我在 Windows 上有 python 3.7

Use the following command to get the latest version of Pillow使用以下命令获取最新版本的 Pillow

pip install wheel
pip install Pillow

I have done it in Google Colab我已经在 Google Colab 中完成了在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 即使 Pillow 已经安装,也无法导入 PIL.Image? - Could not import PIL.Image even if Pillow already installed? 安装包(Python PIL / Pillow)但我无法导入它 - Package (Python PIL/Pillow) installed but I can't import it 使用枕头导入图像:没有名为“ PIL”的模块 - Import Image using Pillow : No module named 'PIL' Tensorflow 加载PIL时导入错误(枕头) - Tensorflow import error when loading PIL (pillow) 无法从 PIL 导入 PILLOW_VERSION - Could not import PILLOW_VERSION from PIL 我正在尝试使用“pip install Pillow”安装枕头,但出现错误 - I am trying to install pillow using 'pip install Pillow' but I am getting error 我收到一个属性错误,当我使用 PIL 导入时,对象图像没有打开属性 - I am getting an Atribute error that the object image does not have atibute open when I import using PIL 如何从PIL / Pillow在Windows下的Python3.5中导入图像 - How to import Image in Python3.5 under windows from PIL/Pillow 使用 Pillow (PIL) 库,我试图从文件夹中获取图像,将所有图像从 JPG 转换为 PNG,但它在命令提示符下不起作用 - Using Pillow (PIL) Library, I am trying to take images from a folder, convert all of them from JPG to PNG but it does not work in the command prompt 使用“load_img”需要安装 PIL 和枕头 - use of 'load_img' requiers PIL and pillow is installed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM