OSError:无法在路径上找到 Ghostscript

OSError: Unable to locate Ghostscript on paths(OSError:无法在路径上找到 Ghostscript)
本文介绍了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.

这篇关于OSError:无法在路径上找到 Ghostscript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

How can I read system information in Python on Windows?(如何在 Windows 上读取 Python 中的系统信息?)
How to get the newest directory in Python(如何在 Python 中获取最新目录)
Python - Get Path of Selected File in Current Windows Explorer(Python - 在当前 Windows 资源管理器中获取所选文件的路径)
Print out the whole directory tree(打印出整个目录树)
Python os.stat and unicode file names(Python os.stat 和 unicode 文件名)
A system independent way using python to get the root directory/drive on which python is installed(使用 python 获取安装 python 的根目录/驱动器的系统独立方式)