python调用git在windows_Python脚本在Windows命令行抛出WindowsError,在gitbash中工作

我目前正在为一所学校构建Adblock Plus的源代码

项目和我正在使用Autoinstall插件轻松部署到

但是,Python中提供的构建工具似乎只起作用

因为某些原因,当他们被处决的时候。在

下面是当我尝试在

Windows命令行:C:\Users\Evert\Documents\GitHub\adblockplus>python build.py autoinstall 8888

Traceback (most recent call last):

File "C:\Users\Evert\Documents\GitHub\adblockplus\ensure_dependencies.py", line 380, in

resolve_deps(repo)

File "C:\Users\Evert\Documents\GitHub\adblockplus\ensure_dependencies.py", line 324, in resolve_deps

update_repo(target, vcs, rev)

File "C:\Users\Evert\Documents\GitHub\adblockplus\ensure_dependencies.py", line 272, in update_repo

resolved_revision = repo_types[type].get_revision_id(target, revision)

File "C:\Users\Evert\Documents\GitHub\adblockplus\ensure_dependencies.py", line 106, in get_revision_id

return subprocess.check_output(command, cwd=repo).strip()

File "C:\Python27\lib\subprocess.py", line 212, in check_output

process = Popen(stdout=PIPE, *popenargs, **kwargs)

File "C:\Python27\lib\subprocess.py", line 390, in __init__

errread, errwrite)

File "C:\Python27\lib\subprocess.py", line 640, in _execute_child

startupinfo)

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

Command '['C:\\Python27\\python.exe', 'C:\\Users\\Evert\\Documents\\GitHub\\adblockplus\\ensure_dependencies.py', 'C:\\Users\\Evert\\Documents\\GitHub\\adblockplus']' returned non-zero exit status 1

Failed to ensure dependencies being up-to-date!

Traceback (most recent call last):

File "build.py", line 18, in

buildtools.build.processArgs(BASE_DIR, sys.argv)

File "C:\Users\Evert\Documents\GitHub\adblockplus\buildtools\build.py", line 601, in processArgs

commands[command](baseDir, scriptName, opts, args, type)

File "C:\Users\Evert\Documents\GitHub\adblockplus\buildtools\build.py", line 55, in __call__

return self._handler(baseDir, scriptName, opts, args, type)

File "C:\Users\Evert\Documents\GitHub\adblockplus\buildtools\build.py", line 225, in runAutoInstall

packager.autoInstall(baseDir, type, host, port, multicompartment=multicompartment)

File "C:\Users\Evert\Documents\GitHub\adblockplus\buildtools\packagerGecko.py", line 334, in autoInstall

createBuild(baseDir, type=type, outFile=fileBuffer, multicompartment=multicompartment)

File "C:\Users\Evert\Documents\GitHub\adblockplus\buildtools\packagerGecko.py", line 294, in createBuild

version = getBuildVersion(baseDir, metadata, releaseBuild, buildNum)

File "C:\Users\Evert\Documents\GitHub\adblockplus\buildtools\packager.py", line 58, in getBuildVersion

buildNum = getBuildNum(baseDir)

File "C:\Users\Evert\Documents\GitHub\adblockplus\buildtools\packager.py", line 46, in getBuildNum

result = subprocess.check_output(['git', 'rev-list', 'HEAD'], cwd=baseDir)

File "C:\Python27\lib\subprocess.py", line 212, in check_output

process = Popen(stdout=PIPE, *popenargs, **kwargs)

File "C:\Python27\lib\subprocess.py", line 390, in __init__

errread, errwrite)

File "C:\Python27\lib\subprocess.py", line 640, in _execute_child

startupinfo)

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

这对我来说并不是什么大问题,因为它确实在建造,但我还是忍不住

想知道:这两种环境有什么区别

这个剧本有用吗?在

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值