2017-04-17 116 views
0

我試圖使用Python scrip,將Latex轉換爲png。圖書館在https://github.com/cptdeadbones/pytex2pngOSError:[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() 

是否有上述功能的錯誤呢?

+0

這個文件,''examples /「+ file'不存在嗎? –

+0

@DmitryPolonskiy該文件存在 – KexAri

+0

您正在使用的操作系統是什麼? – Surajano

回答

1

我希望你已經按照這裏描述的用法:Usage創建Makefile。

你有沒有檢查Disclaimers ??它說如下:

This code was devloped and tested on a Linux based system. I have no idea if it will work on another system. If you have tested it on another system, please let me know.

相關問題