Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x Pypandoc错误,运行时错误:转换期间Pandoc与exitcode“47”一起死亡:未找到b'pdflatex_Python 3.x_Pandoc_Pypandoc - Fatal编程技术网

Python 3.x Pypandoc错误,运行时错误:转换期间Pandoc与exitcode“47”一起死亡:未找到b'pdflatex

Python 3.x Pypandoc错误,运行时错误:转换期间Pandoc与exitcode“47”一起死亡:未找到b'pdflatex,python-3.x,pandoc,pypandoc,Python 3.x,Pandoc,Pypandoc,顺便说一句,我第一次在这里发帖,我对这一行Python 3.6代码有一个问题: file_converted=pandoc.convert_filePATH_TO_ODT,'pdf',format=ODT,outputfile=file_name+.pdf,extra_args=['-pdf engine=pdflatex'] 当我执行脚本将.odt文件转换为.pdf文件时,遇到以下错误: 运行时错误:转换过程中Pandoc与exitcode 47一起死亡:未找到b'pdflatex。请选择其他

顺便说一句,我第一次在这里发帖,我对这一行Python 3.6代码有一个问题:

file_converted=pandoc.convert_filePATH_TO_ODT,'pdf',format=ODT,outputfile=file_name+.pdf,extra_args=['-pdf engine=pdflatex']

当我执行脚本将.odt文件转换为.pdf文件时,遇到以下错误:

运行时错误:转换过程中Pandoc与exitcode 47一起死亡:未找到b'pdflatex。请选择其他-pdf引擎或安装pdflatex

基本上我知道我需要pdflatex,但在我通过pip和命令安装它之后

pip安装pdflatex,执行时产生相同的错误消息,我应该做什么或检查?
谢谢大家。

对于pypandoc,它只调用pandoc命令行程序,然后调用pdflatex,您可能应该在系统范围内安装LaTeX。在Ubuntu上,即:

sudo apt install texlive

对于pypandoc,它只调用pandoc命令行程序,而pandoc命令行程序又调用pdflatex,您可能应该在系统范围内安装LaTeX。在Ubuntu上,即:

sudo apt install texlive

Pandoc实际上自己进行转换——非常复杂的算法。我最近看了主要作者John MacFarlene的介绍,pandoc实际上将源代码转换为它自己的内部格式AST。从AST格式,它可以转换为一长串的文档格式。因此,pandoc不仅仅调用pdflatex。

使用pypadoc本身支持的名称中的另一个pdf引擎,它会产生另一个错误:RuntimeError:pandoc在转换过程中死于exitcode 1:b'pdf-engine wkhtmltopdf与输出格式不兼容我使用的是Ubuntu18.04,感谢使用pypadoc本身支持的名称中的另一个pdf引擎,它会产生另一个错误:RuntimeError:Pandoc在转换过程中死于exitcode 1:b'pdf-engine wkhtmltopdf与最近的输出格式不兼容我正在使用Ubuntu18.04,感谢[它可以工作]在按照您的建议安装texlive之后,我已经运行了以下代码行pandoc.convert_filePATH_TO_ODT,'pdf',format=ODT,outputfile=.pdf,extra_args=['-pdf engine=pdflatex'],它终于可以工作了@mb21非常感谢您,直截了当且有效。谢谢[它可以工作]在按照您的建议安装texlive之后,我运行了以下代码行pandoc.convert_filePATH_TO_ODT,'pdf',format=ODT,outputfile=.pdf,extra_args=['-pdf engine=pdflatex',],它终于可以工作了@mb21非常感谢您,直截了当且有效。谢谢