从Python脚本运行blender时出现coderestryError

2024-05-03 19:25:15 发布

您现在位置:Python中文网/ 问答频道 /正文

我试着把blender作为后台进程运行。我有一个脚本,在blender中进行一些格式转换。在

    blender --background --python /home/WebRendering/scripts/blender_convertToObj.py -i tempForObjGeneration.iv.wrl -o ObjForAR.obj

如果我复制粘贴这一行,就像它在终端中一样,脚本运行并得到所需的输出。但是当我尝试使用subprocess模块从python脚本内部运行它时,我得到了这个错误

^{pr2}$

如果在子进程调用中使用,shell=False,则会得到以下错误

     File "/usr/lib/python2.7/subprocess.py", line 522, in call
return Popen(*popenargs, **kwargs).wait()
     File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
     File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
     raise child_exception
     OSError: [Errno 2] No such file or directory

有什么想法吗,错误的原因是什么? 另外,在终端中直接运行脚本和通过子进程运行脚本有什么区别?在

搅拌机版本-2.69 Python版本-2.7


Tags: inpy版本脚本child终端进程lib