【问题标题】:Importing Ghostscript on Windows 10在 Windows 10 上导入 Ghostscript
【发布时间】: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


【解决方案1】:

根据the documentationghostscript PyPi 包需要现有的 Ghostscript 安装:

python-ghostscript 需要

  • Python 2.7 或更高版本(使用 Python 2.7、3.4、3.6 和 3.6 测试)
  • 用于安装的设置工具(见下文)
  • Ghostscript 版本 8.x 或更高版本(使用 9.x 测试)

您可以下载Ghostscript for Windows here

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-09-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-07-17
    • 1970-01-01
    相关资源
    最近更新 更多