安装了枕头,但无法在Python中导入

发布于 2025-01-24 22:47:42 字数 467 浏览 2 评论 0原文

我想安装枕头库。我通过:

pip install Pillow

当我要导入枕头时,我会使用此代码:

import PIL

我会收到此错误:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'PIL'

安装和导入的所有过程:

I want to install Pillow library. I installed it through:

pip install Pillow

when I want to import Pillow, I use this code:

import PIL

and I receive this error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'PIL'

All the processes of installation and import:
enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冧九 2025-01-31 22:47:42

它在Windows上使用以下命令为我工作:

pip install --upgrade --force-reinstall Pillow

It worked for me on Windows with the following command:

pip install --upgrade --force-reinstall Pillow
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文