【问题标题】:subprocess.py error: Ninja not building from source on Windows 8subprocess.py 错误:Ninja 未在 Windows 8 上从源代码构建
【发布时间】:2017-06-05 10:46:48
【问题描述】:

我尝试从源代码构建 Ninja。我做到了:

$ git clone git://github.com/martine/ninja.git && cd ninja
$ git checkout release

然后在 Visual Studio 命令行中,我使用 Python 运行 configure.py

$ C:\Python27\python.exe configure.py --bootstrap

但在这里我得到以下错误:

C:\ninja>C:\Python27\python.exe configure.py --bootstrap
bootstrapping ninja...
Traceback (most recent call last):
  File "configure.py", line 320, in <module>
    if platform.msvc_needs_fs():
  File "configure.py", line 84, in msvc_needs_fs
    stderr=subprocess.PIPE)
  File "C:\Python27\Lib\subprocess.py", line 390, in __init__
    errread, errwrite)
  File "C:\Python27\Lib\subprocess.py", line 640, in _execute_chi
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified

阅读this 答案后,我将shell=True 添加到configure.py 中的所有call()check_call()。但这仍然没有帮助。

有什么想法吗?

【问题讨论】:

    标签: python python-2.7 subprocess ninja


    【解决方案1】:

    查看code in question,它正在尝试运行cl,它是Microsoft Visual C++ 的一部分。

    您是否安装了 MSVC 并在您的 PATH 中? IE。只是在命令行上运行cl 有效吗?

    【讨论】:

    • 只是在命令行上运行cl 是行不通的,虽然我已经安装了 Microsoft Visual C++。
    • 所以这可能意味着它不在 PATH 上。见msdn.microsoft.com/en-us/library/f2ccy3wt.aspx :)
    • 我搜索了整个 C:\ 驱动器,但找不到 Microsoft Visual C++ 的路径。但是,我确实在已安装应用程序列表中看到它(在控制面板的程序和功能中)。
    猜你喜欢
    • 2018-05-06
    • 1970-01-01
    • 1970-01-01
    • 2018-03-05
    • 2015-03-02
    • 1970-01-01
    • 2014-07-16
    • 2021-01-01
    • 1970-01-01
    相关资源
    最近更新 更多