当尝试运行hello-world示例时
import sys
import ghostscript
args = [
"ps2pdf", # actual value doesn't matter
"-dNOPAUSE", "-dBATCH", "-dSAFER",
"-sDEVICE=pdfwrite",
"-sOutputFile=" + sys.argv[1],
"-c", ".setpdfwrite",
"-f", sys.argv[2]
]
ghostscript.Ghostscript(*args)获取错误:
File "/Users/ddd/sss/ddd/eee.py", line 2, in <module>
import ghostscript
File "build/bdist.macosx-10.6-universal/egg/ghostscript/__init__.py", line 33, in <module>
File "build/bdist.macosx-10.6-universal/egg/ghostscript/_gsprint.py", line 290, in <module>
RuntimeError: Can not find Ghostscript library (libgs)这个libgs库是什么?我如何获取它?
顺便说一句,我在mac上
发布于 2021-12-01 10:41:23
对于使用M1 mac的新用户,ghostscript可能会显示缺少libgs文件的错误,并且该文件在usr/local/lib上不可用
该问题可以通过以下步骤解决,顺序相同:
brew install ghostscriptconda install ghostscript,会从conda - conda install -c conda-forge ghostscriptpip install ghostscript安装基于arm_64的库,如果conda抛出通道错误,请尝试使用
注意:
_gsprint.py中的地址将抛出一个错误,因为brew安装的版本将是基于arm_64的,而安装的pip版本将是基于OS_X86的。除非运行pip安装,否则的重要步骤
发布于 2018-01-02 05:27:33
对我来说,这很简单,因为我已经安装了python部分:
pip install ghostscript但不是C部分:
brew install ghostscript也许这些DMG也是有效的--但我没有走这条路:http://pages.uoregon.edu/koch/
发布于 2011-08-07 20:15:57
除了之外,你还应该看看。
如果这还不能让你上手,你也可以直接在IRC服务器irc.freenode.net上名为#ghostscript的在线聊天频道中询问GS开发人员。他们是一群非常友好和乐于助人的人。
https://stackoverflow.com/questions/6848903
复制相似问题