Subprocess.py错误

时间:2012-01-04 20:27:30

标签: android python subprocess

我想要complie游戏到android但是......

我遇到Subprocess.py

的问题

我收到以下错误消息:

File "D:\Documents and Settings\Kiraler\Pulpit\renpy-apk-6.13.7.1\build.py", line 321, in <module> 
make_package<args>
File D:\Documents and Settings\Kiraler\Pulpit\renpy-apk-6.13.7.1\build.py", line 201, in make_package 
subprocess.call<[ANDROID, "update", "project", "-p", '.', '-t', android-8]

File "D:\Python27\lib\subprocess.py", line 493, in call
return Popen<*popenargs, **kwargs>.wait<> 

File "D:\Python27\lib\subprocess.py", line 679, in __init__
errread, errwrite>

File "D:\Python27\lib\subprocess.py", line 893, in _execute_child
startupinfo>

WindowsError: [Error 2] The system cannot find the file specified

模块:

# Update the project to a recent version.
subprocess.call([ANDROID, "update", "project", "-p", '.', '-t', 'android-8'])

shutil.rmtree("assets")

if args.assets:
    shutil.copytree(args.assets, "assets")

else:
    os.mkdir("assets")

if renpy:
    shutil.copytree("engine-assets/common", "assets/common")

有人可以帮助我吗?

1 个答案:

答案 0 :(得分:0)

我要说问题是代码中的ANDROID变量不是您要使用的二进制文件的完全限定路径名。

因此,只要您已正确配置shell=True环境变量以便找到PATH,建议使用ANDROID的评论就会合适。 / p>

如果情况并非如此,您可以:

  • 提供ANDROID变量
  • 中的完整路径
  • 在调用env时使用subprocess.Popen参数,为子流程提供自定义的PATH环境变量。欲获得更多信息, 请查看documentation