gpt4 book ai didi

python - 在 Ubuntu 16.04 上导入 pycreenshot 会出现错误 "No module named ' PIL'"

转载 作者:太空宇宙 更新时间:2023-11-03 14:16:09 25 4
gpt4 key购买 nike

我正在尝试使用 Python 版本 3.5.2 在 Ubuntu 16.04 上使用 pyscreenshot

我已按照 pyscreenshot 网站上的 Ubuntu 安装说明进行操作:

sudo apt-get install python-pip
sudo apt-get install python-pil
sudo pip install pyscreenshot

Python 代码失败:

import pyscreenshot as ImageGrab

出现此错误消息:

from PIL import Image
ImportError: 'No module named PIL'

我在其他 StackOverflow 问题上看到过提到我应该尝试

sudo apt-get install python3-pil

但这也没有帮助,提前感谢您的帮助。

最佳答案

对我有用的是安装 Pillow 而不是 PIL:

pip install pillow

关于python - 在 Ubuntu 16.04 上导入 pycreenshot 会出现错误 "No module named ' PIL'",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48229183/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com