OSError:无法在路径上找到 Ghostscript

问题描述

我尝试用 Pyzo 打开 EPS 图像,我已经安装了 PIL 和 Ghostscript(因为我看到在其他一些网站主题上是必需的),我的代码是:

I tried to open an EPS image with Pyzo, I have installed PIL and Ghostscript (as I saw that it is necessary on some other website topics), my code is:

from PIL import Image
im = Image.open('''myimage.eps''')
im.show()

但是当我运行代码时,Pyzo 会返回:

but when I run the code, Pyzo return me:

OSError: 无法在路径上找到 Ghostscript

OSError: Unable to locate Ghostscript on paths

我尝试在几个网站上查看它,但对于新手编码学生来说似乎相当复杂.

I tried to look into it on several websites but it seems pretty complicated for a novice coding student.


解决方案

万一其他人遇到这个问题: 似乎Ghostscript没有正确添加到路径中.对于那些运行 Win7 的人,这里有一个修复:

In case someone else encounters this issue: It seems that Ghostscript has not been added to the paths properly. For those running Win7, here is a fix:

转到:控制面板 -> 系统 -> 高级系统设置 -> 环境变量...

Go to: Control Panel -> System -> Advanced system settings -> Environment Variables...

找到变量PATH" -> 编辑... -> 将路径添加到您的 ghostscript 二进制文件夹,例如

Find the variable "PATH" -> Edit... -> add the path to your ghostscript binary folder, e.g.

C:Program Filesgsgs9.22in;

C:Program Filesgsgs9.22in;

到变量的末尾.它应该用分号与上一个条目分隔.

to the end of the variable. It should be separated from the previous entry by a semicolon.

我必须重新启动才能使更改生效.

I had to restart for the changes to take effect.

相关文章