cl.exe失败,退出状态为2

时间:2018-02-13 20:56:16

标签: python-3.x

我到处寻找解决此错误的方法。我不是python或编程的专家,但我已经遵循了各种建议而没有结果。

尝试将cl.exe添加到我的环境PATH bot用户和系统。

安装Microsoft Visual C ++工具2015,在第一次运行命令并将其作为输出中的解决方案。

还尝试安装MinGW python发行版,某个地方的线程推荐它,什么都没有。

我不确定它是否是我使用过的CMD,因此在普通的Windows中以及视觉工作室中的包管理器都尝试了同样的错误。

从我收集它的一个Windows问题,但我不知道这在找到修复方面意味着什么。

Microsoft Windows [Version 10.0.16299.192]
(c) 2017 Microsoft Corporation. All rights reserved.

C:\Users\User>pip install rebound
Collecting rebound
  Using cached rebound-3.5.12.tar.gz
Building wheels for collected packages: rebound
  Running setup.py bdist_wheel for rebound ... error
  Complete output from command c:\users\user\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\User\\AppData\\Local\\Temp\\pip-build-h7n58o8k\\rebound\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\User\AppData\Local\Temp\tmpgvqt5nrzpip-wheel- --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.6
  creating build\lib.win-amd64-3.6\rebound
  copying rebound\data.py -> build\lib.win-amd64-3.6\rebound
  copying rebound\debug.py -> build\lib.win-amd64-3.6\rebound
  copying rebound\horizons.py -> build\lib.win-amd64-3.6\rebound
  copying rebound\interruptible_pool.py -> build\lib.win-amd64-3.6\rebound
  copying rebound\particle.py -> build\lib.win-amd64-3.6\rebound
  copying rebound\plotting.py -> build\lib.win-amd64-3.6\rebound
  copying rebound\simulation.py -> build\lib.win-amd64-3.6\rebound
  copying rebound\simulationarchive.py -> build\lib.win-amd64-3.6\rebound
  copying rebound\tools.py -> build\lib.win-amd64-3.6\rebound
  copying rebound\units.py -> build\lib.win-amd64-3.6\rebound
  copying rebound\widget.py -> build\lib.win-amd64-3.6\rebound
  copying rebound\__init__.py -> build\lib.win-amd64-3.6\rebound
  copying rebound\rebound.h -> build\lib.win-amd64-3.6\rebound
  running build_ext
  building 'librebound' extension
  creating build\temp.win-amd64-3.6
  creating build\temp.win-amd64-3.6\Release
  creating build\temp.win-amd64-3.6\Release\src
  C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DLIBREBOUND -Isrc -Ic:\users\user\appdata\local\programs\python\python36\include -Ic:\users\user\appdata\local\programs\python\python36\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" /Tcsrc/rebound.c /Fobuild\temp.win-amd64-3.6\Release\src/rebound.obj -fstrict-aliasing -O3 -std=c99 -Wno-unknown-pragmas -DGITHASH=c7087474e5b18039d66c506088164c06e2c3659e -DLIBREBOUND -D_GNU_SOURCE -fPIC
  cl : Command line error D8021 : invalid numeric argument '/Wno-unknown-pragmas'
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2

  ----------------------------------------
  Failed building wheel for rebound
  Running setup.py clean for rebound
Failed to build rebound
Installing collected packages: rebound
  Running setup.py install for rebound ... error
    Complete output from command c:\users\user\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\User\\AppData\\Local\\Temp\\pip-build-h7n58o8k\\rebound\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\User\AppData\Local\Temp\pip-zpsleveu-record\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.6
    creating build\lib.win-amd64-3.6\rebound
    copying rebound\data.py -> build\lib.win-amd64-3.6\rebound
    copying rebound\debug.py -> build\lib.win-amd64-3.6\rebound
    copying rebound\horizons.py -> build\lib.win-amd64-3.6\rebound
    copying rebound\interruptible_pool.py -> build\lib.win-amd64-3.6\rebound
    copying rebound\particle.py -> build\lib.win-amd64-3.6\rebound
    copying rebound\plotting.py -> build\lib.win-amd64-3.6\rebound
    copying rebound\simulation.py -> build\lib.win-amd64-3.6\rebound
    copying rebound\simulationarchive.py -> build\lib.win-amd64-3.6\rebound
    copying rebound\tools.py -> build\lib.win-amd64-3.6\rebound
    copying rebound\units.py -> build\lib.win-amd64-3.6\rebound
    copying rebound\widget.py -> build\lib.win-amd64-3.6\rebound
    copying rebound\__init__.py -> build\lib.win-amd64-3.6\rebound
    copying rebound\rebound.h -> build\lib.win-amd64-3.6\rebound
    running build_ext
    building 'librebound' extension
    creating build\temp.win-amd64-3.6
    creating build\temp.win-amd64-3.6\Release
    creating build\temp.win-amd64-3.6\Release\src
    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DLIBREBOUND -Isrc -Ic:\users\user\appdata\local\programs\python\python36\include -Ic:\users\user\appdata\local\programs\python\python36\include "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10240.0\ucrt" /Tcsrc/rebound.c /Fobuild\temp.win-amd64-3.6\Release\src/rebound.obj -fstrict-aliasing -O3 -std=c99 -Wno-unknown-pragmas -DGITHASH=c7087474e5b18039d66c506088164c06e2c3659e -DLIBREBOUND -D_GNU_SOURCE -fPIC
    cl : Command line error D8021 : invalid numeric argument '/Wno-unknown-pragmas'
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2

    ----------------------------------------
Command "c:\users\user\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\User\\AppData\\Local\\Temp\\pip-build-h7n58o8k\\rebound\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\User\AppData\Local\Temp\pip-zpsleveu-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\User\AppData\Local\Temp\pip-build-h7n58o8k\rebound\

C:\Users\User>

1 个答案:

答案 0 :(得分:-1)

在窗口cmd / powershell上执行以下命令并重启cmd提示符。它对我有用。

$ env:VCINSTALLDIR =" C:\ Program Files(x86)\ Microsoft Visual Studio 14.0 \ VC" $ ENV:CL =" -FI "$env:VCINSTALLDIR\INCLUDE\stdint.h""