python-3.x - Pypandoc 错误,RuntimeError:Pandoc 在转换过程中因退出代码“47”而死:未找到 b'pdflatex
问题描述
第一次在这里发帖,顺便说一句,我对这行特定的 Python (3.6) 代码有疑问:
file_converted = pandoc.convert_file(PATH_TO_ODT, 'pdf', format="odt", outputfile=file_name + ".pdf", extra_args=['--pdf-engine=pdflatex'])
当我执行脚本(将 .odt 文件转换为 .pdf 文件)时,遇到以下错误:
RuntimeError: Pandoc died with exitcode "47" during conversion: b'pdflatex not found. Please select a different --pdf-engine or install pdflatex
基本上我知道我需要“pdflatex”,但是在我通过 pip 使用命令安装它之后
pip install pdflatex
,执行产生相同的错误消息,我应该做什么或检查?谢谢你们。
解决方案
对于 pypandoc,它只是调用pandoc
命令行程序,而后者又调用pdflatex
,您可能应该在系统范围内安装 LaTeX。在 Ubuntu 上,即:
sudo apt install texlive
推荐阅读
- python - 根据其他列的条件生成多列
- python - 使用熊猫读取 csv 文件时出现 IndexError
- datetime - 如何表示时钟
- gammu - 使用 Gammu 发送短信失败
- google-bigquery - BigQuery Standard 分组时获取第一个非空值
- python - 为什么'datetime.date'对象没有属性'__dict__'?
- c++ - 显示抛出 std::out_of_range 实例的错误
- java - 如何在存储在列表中的多个分隔符上拆分字符串?
- javascript - 如何使用 javascript 打开和关闭折叠
- asp.net-core-mvc - 在操作方法 ASP.Net MVC Core 之间传递复杂对象