Python 如何修复使用Pillow时的Ghostscript操作系统错误?

Python 如何修复使用Pillow时的Ghostscript操作系统错误?,python,python-imaging-library,ghostscript,Python,Python Imaging Library,Ghostscript,这就是我得到的错误: OS Error: Ghostscript not found on paths 运行以下功能时: from PIL import Image def convert_ps_to_png(ps_file): img = Image.open(ps_file) img = Image.save("file.png")# Error occurs on this line convert_ps_to_png(ps_file_path) 任何解决方案都将

这就是我得到的错误:

OS Error: Ghostscript not found on paths
运行以下功能时:

from PIL import Image
def convert_ps_to_png(ps_file):
    img = Image.open(ps_file)  
    img = Image.save("file.png")# Error occurs on this line

convert_ps_to_png(ps_file_path)

任何解决方案都将不胜感激。最终目标是通过脚本将.ps文件转换为.png文件。

根据前面问题的答案,您需要安装Ghostscript,并在系统环境变量$PATH中提供