Raspberry pi 不会显示 pil 图片

Raspberry pi won't show pil image

我得到了 raspberry pi 相机模块并按照示例中未显示的内容将捕获保存到图像中的另一个 PIL,但图像不会显示。当我引用 shell 中的图像时,一切似乎都正常但显示它。代码在 http://picamera.readthedocs.org/en/latest/recipes1.html 上的 4.3(我没有输入代码,因为我是在手机上写的)。在 shell 中输入图像时,它 returns <PIL.jpegimageplugin.jpegimagefile image mode=RGB size=1280x720 at 0x1486690>

在我调用 image.show 之后没有任何显示。

image.show() 调用外部查看器程序。如果您没有或 运行 在非图形环境中,它不会执行任何操作。

遇到同样的问题,通过安装ImageMagick解决了。在 Ubuntu/Debian 的情况下:

sudo apt install imagemagick

之后重新启动您的 python 脚本。