Python 运行时错误:未安装pdf Latex
当我试着运行上面的代码时,它说我没有安装pidflatex,即使我已经安装了pip的latex、tex和pdflatex。 在测试另一段代码时,我也运行了以下几行代码,但它没有获得任何结果:Python 运行时错误:未安装pdf Latex,python,python-3.x,latex,pdflatex,Python,Python 3.x,Latex,Pdflatex,当我试着运行上面的代码时,它说我没有安装pidflatex,即使我已经安装了pip的latex、tex和pdflatex。 在测试另一段代码时,我也运行了以下几行代码,但它没有获得任何结果: $ schtex drawing.sch drawing.png 它也给了我一个错误 from sympy.utilities.misc import find_executable find_executable('latex') 回溯(最近一次呼叫最后一次): 文件“/Library/Framewo
$ schtex drawing.sch drawing.png
它也给了我一个错误
from sympy.utilities.misc import find_executable
find_executable('latex')
回溯(最近一次呼叫最后一次):
文件“/Library/Frameworks/Python.framework/Versions/3.9/bin/schtex”,第8行,在
sys.exit(main())
文件“/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site packages/lcapy/scripts/schtex.py”,第231行,在main中
cct.draw(label_节点=args.label_节点,
文件“/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site packages/lcapy/netlistmixin.py”,绘图中第1624行
返回cct.sch.draw(文件名=文件名,**kwargs)
文件“/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site packages/lcapy/schematic.py”,第792行,在绘图中
self.tikz_draw(文件名=文件名,**kwargs)
文件“/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/lcapy/schematic.py”,第597行,在tikz_-draw中
self.circuitikz_日期,self.circuitikz_版本=latexrunner.circuitikz_版本()
文件“/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site packages/lcapy/system.py”,第230行,在circuitikz_版本中
self.run(tex_文件名)
文件“/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site packages/lcapy/system.py”,第183行,正在运行
checkexe('pdflatex')
checkexe中的文件“/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site packages/lcapy/system.py”,第68行
引发运行时错误(“%s”未安装“%s”程序)
运行时错误:未安装pdflatex
根据我的经验,运行这些软件包需要在您的计算机上安装LaTeX发行版(其中包含pdflatex
)
我建议您使用teXlive,这是最常见的:
您也可以使用MikTeX,这也是一个非常常见的发行版:工作得非常好!非常感谢您的回复,很抱歉回复太晚。欢迎使用!很高兴它有帮助!
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