【问题标题】:RunTimeError: pdf Latex not installRunTimeError: pdf Latex 未安装
【发布时间】:2021-05-14 18:21:45
【问题描述】:
$ schtex drawing.sch drawing.png

当我尝试运行上面的代码时,它说我没有安装 pidflatex,即使我已经 pip 安装了 latex、tex 和 pdflatex。 我在测试另一段代码时也运行了以下几行代码,但它没有获得任何东西:

from sympy.utilities.misc import find_executable
find_executable('latex')

它也给了我一个错误

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/bin/schtex", line 8, in <module>
    sys.exit(main())
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/lcapy/scripts/schtex.py", line 231, in main
    cct.draw(label_nodes=args.label_nodes,
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/lcapy/netlistmixin.py", line 1624, in draw
    return cct.sch.draw(filename=filename, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/lcapy/schematic.py", line 792, in draw
    self.tikz_draw(filename=filename, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/lcapy/schematic.py", line 597, in tikz_draw
    self.circuitikz_date, self.circuitikz_version = latexrunner.circuitikz_version()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/lcapy/system.py", line 230, in circuitikz_version
    self.run(tex_filename)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/lcapy/system.py", line 183, in run
    checkexe('pdflatex')
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/lcapy/system.py", line 68, in checkexe
    raise RuntimeError('%s is not installed' % program)
RuntimeError: pdflatex is not installed

【问题讨论】:

    标签: python python-3.x latex pdflatex


    【解决方案1】:

    根据我的经验,运行这些软件包需要在您的计算机上实际安装 LaTeX 发行版(其中包含 pdflatex)。

    我建议您使用 teXlive,这是最常见的一种:https://www.tug.org/texlive/

    您也可以使用 MikTeX,这也是一个非常常见的发行版:https://miktex.org/

    【讨论】:

    • 完美运行!非常感谢,很抱歉回复晚了
    猜你喜欢
    • 2019-08-28
    • 1970-01-01
    • 2022-01-16
    • 2013-08-12
    • 1970-01-01
    • 1970-01-01
    • 2019-06-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多