python - 如何在Windows中将ghostscript DLL库提供给python?

标签 python windows ghostscript python-3.9

背景。我想使用camelot.read_pdf(file)它使用 Ghostscript。

  1. 该项目有 ghostscript 包。
  2. Windows 10 已安装 Ghostscript 9.54.0 for Windows (64 bit) 。 2.1. c:\Program Files\gs\gs9.54.0\bin 已添加到系统 PATH 环境变量中。
  3. Python 3.9 64 位。

所需的库路径是c:\Program Files\gs\gs9.54.0\bin\gsdll64.dll
但Python并没有“看到”它。因为它可能没有加载到系统中。

  File "C:\Users\USERNAME\.virtualenvs\PROJECT\lib\site-packages\camelot\backends\ghostscript_backend.py", line 31, in convert
    raise OSError(
OSError: Ghostscript is not installed. You can install it using the instructions here: https://camelot-py.readthedocs.io/en/master/user/install-deps.html

那么,它应该如何工作?我错过了哪一步?

最佳答案

已解决。

首先,Python可以通过环境PATH变量中的路径找到DLL。因此,路径 c:\Program Files\gs\gs9.54.0\bin 必须出现在那里。

PyCharm(或其他 IDE)必须重新加载(这是我的主要错误)。

感谢@Petesh 的评论。

关于python - 如何在Windows中将ghostscript DLL库提供给python?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69064465/

相关文章:

php - 将裁剪框和出血框添加到现有 PDF

pdf - 保留文件名 Ghostscript

pdf - 动态生成的 PDF 文件适用于除 Adob​​e Reader 之外的大多数阅读器

python - scikit-learn/Gaussian Process 不是尺度不变的

python - 如何将 httpie 与 httpie-aws-authv4 捆绑到 Python zipapp 中?

windows - 手动卸载后无法通过注册表重新安装 Chrome 扩展

windows - 避免从锁定构建目录的东西中彻底失败(并因此构建)

windows - 设置 Tortoise SVN Windows 7 热键

python - 无法从网站下载 CSV 文件

python - Python 中的字母数字排序和负数