python - 如何在 Windows 中将 ghostscript DLL 库提供给 python?
问题描述
背景。我想使用camelot.read_pdf(file)
哪个使用ghostscript。
- 该项目有
ghostscript
包。 - Windows 10 安装了Ghostscript 9.54.0 for Windows (64 bit)。2.1。
c:\Program Files\gs\gs9.54.0\bin
已添加到系统环境PATH
变量中。 - 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 的评论。
推荐阅读
- javascript - 图像上的可点击标记点
- excel - Excel - 将序列号添加到已排序的地址数据列表中,以非顺序方式对各个名字进行排名
- openmp - 如何openmp并行化增加两个变量的循环
- c# - 如何从 C# 中读取 Cosmos DB 中的布尔值
- javascript - 对象作为 React 子对象无效(找到:带有键 {information} 的对象)
- python-3.x - 在 AWS Lambda 上使用 PyTorch
- javascript - Chrome扩展程序:获取下载文件的内容
- unity3d - 为什么 navmesh 可以检测到我模型的所有细节,而 meshcollier 不能?
- perl - 如何在 Perl 中的两个特定符号之间选择文本?
- google-visualization - 谷歌图表“未捕获(承诺)错误:列索引 3 无效。应该是 [0-3] 范围内的整数。”