0
我試圖使用Python scrip,將Latex
轉換爲png
。圖書館在https://github.com/cptdeadbones/pytex2png。OSError:[Errno 2]沒有這樣的文件或目錄與python2.7/subprocess.py
當我運行命令python examples.py
我收到以下錯誤:
Traceback (most recent call last):
File "./examples.py", line 14, in <module>
main()
File "./examples.py", line 11, in main
pytex2png.convert("examples/"+file,"output/"+file+".png")
File "/Users/kekearif/Desktop/pytex2png-master/pytex2png.py", line 44, in convert
make_transparent_bg(output,display)
File "/Users/kekearif/Desktop/pytex2png-master/pytex2png.py", line 31, in make_transparent_bg
exe_command(command_line)
File "/Users/kekearif/Desktop/pytex2png-master/pytex2png.py", line 11, in exe_command
p = subprocess.Popen(args,stdout=subprocess.PIPE)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 390, in __init__
errread, errwrite)
File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1024, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory'
這個錯誤是什麼意思?它是如何傳遞參數的錯誤?
從來源:
def exe_command(cmd, display=False):
args = shlex.split(cmd)
if(display):
p = subprocess.Popen(args)
else:
p = subprocess.Popen(args,stdout=subprocess.PIPE)
p.wait()
是否有上述功能的錯誤呢?
這個文件,''examples /「+ file'不存在嗎? –
@DmitryPolonskiy該文件存在 – KexAri
您正在使用的操作系統是什麼? – Surajano