我在 PyCharm 内的 64 位 Windows 10 上的 venv 中运行 Python 3.6。以下是我执行的步骤:
- 打开 PyCharm 并使用 Python 3.6 作为 venv 启动一个新项目。
- 从以下来源下载 Python3.6 的轮子文件中的 PythonMagick:PythonMagick 轮子文件
在 PyCharm 中打开终端并运行:
pip install PythonMagick-0.9.19-cp36-cp36m-win_amd64.whl
从此处下载 ghostscript:Ghostscript 9.25 for Windows(64 位)并运行 exe 文件。
将 ghostscript 目录添加
C:\Program Files\gs\gs9.25\bin
到用户 PATH 环境变量中。
现在我从这里运行示例文件
import PythonMagick
if __name__ == "__main__":
pdf = 'a.pdf'
p = PythonMagick.Image()
p.read(pdf)
p.write('doc.jpg')
我收到以下错误:
RuntimeError:Magick:UnableToOpenConfigureFile `delegates.xml'@warning/configure.c/GetConfigureOptions/714
如何修复此错误?