【发布时间】:2021-01-05 22:31:39
【问题描述】:
我正在尝试将 ghostscript 导入 Python
当我输入 import ghostscript 时,我收到以下错误消息:
Traceback(最近一次调用最后一次):文件“
”,第 1 行,在 导入 ghostscript 文件 "C:\Users...\AppData\Local\Programs\Python\Python38-32\lib\site-packages\ghostscript_init_.py", 第 35 行,在 从 。将 _gsprint 导入为 gs 文件“C:\Users...\AppData\Local\Programs\Python\Python38-32\lib\site-packages\ghostscript_gsprint.py”, 第 505 行,在 raise RuntimeError('Can not find Ghostscript DLL in registry') RuntimeError: Can not find Ghostscript DLL in registry
我使用的是 Windows 10。
我已确认我使用的是 Python 3.8.3,32 位。
我找到了这个帖子:Importing Ghostscript in Python on Windows 8,但它不是很有帮助。
有什么建议吗?
我不确定如何判断我使用的是 32 位还是 64 位的 ghostscript。
编辑#1:
我通过python -m pip install ghostscript安装了Ghostscript
【问题讨论】:
-
您肯定下载并安装了实际的 Ghostscript 程序,对吧? ghostscript.com/download.html 如果没有那就难怪了。
-
编辑了我的帖子,我不能只使用 pip 命令?
-
可以,但您还需要安装 Ghostscript for Windows。你可以在这里下载:ghostscript.com/download/gsdnld.html
-
@LunchBox 根据PyPi page,前提安装是Python 2.7或更高版本,setuptools,和Ghostscript。
-
解决了这个问题。谢谢!
标签: python ghostscript python-3.8