繁体   English   中英

OSError:[Errno 2] python2.7 / subprocess.py中没有这样的文件或目录

[英]OSError: [Errno 2] No such file or directory with python2.7/subprocess.py

我正在尝试使用将Latex转换为png的Python脚本。 该库位于https://github.com/cptdeadbones/pytex2png

当我运行命令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() 

上面的函数有错误吗?

我希望您遵循此处描述的用法:创建Makefile的用法

您检查免责声明了吗? 它说如下:

该代码已在基于Linux的系统上开发和测试。 我不知道它是否可以在另一个系统上工作。 如果您已在其他系统上测试过,请告诉我。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM