[英]Error with installing REBOUND in Python/PIP: …Microsoft Visual Studio\\MSVC\\14.28.29333\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
I have a problem with installing Rebound via pip on Python.我在 Python 上通过 pip 安装 Rebound 时遇到问题。 I initialize the installation with:我初始化安装:
pip3 install rebound
Output starts with the following: Output 开头如下:
Collecting rebound
Using cached rebound-3.14.0.tar.gz (250 kB)
Using legacy 'setup.py install' for rebound, since package 'wheel' is not installed.
Installing collected packages: rebound
Running setup.py install for rebound ... \
and then an error appears:然后出现错误:
Running setup.py install for rebound ... \ WARNING: Subprocess output does not appear to be encoded as cp1250
error
ERROR: Command errored out with exit status 1:
command: 'c:\users\jacob\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Jacob\\AppData\\Local\\Temp\\pip-install-clca5gs3\\rebound_a19ceff23d4844dfb1d9ce4d08fba984\\setup.py'"'"'; __file__='"'"'C:\\Users\\Jacob\\AppData\\Local\\Temp\\pip-install-clca5gs3\\rebound_a19ceff23d4844dfb1d9ce4d08fba984\\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\Jacob\AppData\Local\Temp\pip-record-8w1f5up7\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\jacob\appdata\local\programs\python\python39\Include\rebound'
cwd: C:\Users\Jacob\AppData\Local\Temp\pip-install-clca5gs3\rebound_a19ceff23d4844dfb1d9ce4d08fba984\
Complete output (27 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.9
creating build\lib.win-amd64-3.9\rebound
copying rebound\citations.py -> build\lib.win-amd64-3.9\rebound
copying rebound\data.py -> build\lib.win-amd64-3.9\rebound
copying rebound\horizons.py -> build\lib.win-amd64-3.9\rebound
copying rebound\interruptible_pool.py -> build\lib.win-amd64-3.9\rebound
copying rebound\particle.py -> build\lib.win-amd64-3.9\rebound
copying rebound\plotting.py -> build\lib.win-amd64-3.9\rebound
copying rebound\simulation.py -> build\lib.win-amd64-3.9\rebound
copying rebound\simulationarchive.py -> build\lib.win-amd64-3.9\rebound
copying rebound\tools.py -> build\lib.win-amd64-3.9\rebound
copying rebound\units.py -> build\lib.win-amd64-3.9\rebound
copying rebound\widget.py -> build\lib.win-amd64-3.9\rebound
copying rebound\__init__.py -> build\lib.win-amd64-3.9\rebound
copying rebound\rebound.h -> build\lib.win-amd64-3.9\rebound
running build_ext
building 'librebound' extension
creating build\temp.win-amd64-3.9
creating build\temp.win-amd64-3.9\Release
creating build\temp.win-amd64-3.9\Release\src
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DLIBREBOUND -Isrc -Ic:\users\jacob\appdata\local\programs\python\python39\include -Ic:\users\jacob\appdata\local\programs\python\python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.28.29333\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt /Tcsrc/binarydiff.c /Fobuild\temp.win-amd64-3.9\Release\src/binarydiff.obj -fstrict-aliasing -O3 -std=c99 -Wno-unknown-pragmas -DGITHASH=eb1f3890ab7f01487de2b3d01c42c1acdfd9d5e5 -DLIBREBOUND -D_GNU_SOURCE -fPIC
cl : Wiersz polecenia error D8021 : nieprawid\x88owy argument numeryczny "/Wno-unknown-pragmas"
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\jacob\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Jacob\\AppData\\Local\\Temp\\pip-install-clca5gs3\\rebound_a19ceff23d4844dfb1d9ce4d08fba984\\setup.py'"'"'; __file__='"'"'C:\\Users\\Jacob\\AppData\\Local\\Temp\\pip-install-clca5gs3\\rebound_a19ceff23d4844dfb1d9ce4d08fba984\\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\Jacob\AppData\Local\Temp\pip-record-8w1f5up7\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\jacob\appdata\local\programs\python\python39\Include\rebound' Check the logs for full command output.
Any idea what is the problem?知道有什么问题吗? It's clearly connected with MSVC.它显然与 MSVC 相关。 At the beginning there was an error which required MSVC ver.一开始有一个错误,需要 MSVC 版本。 14 or higher to be installed.安装 14 或更高版本。 After I've installed MSVC, above error occures.安装 MSVC 后,出现上述错误。
Python ver. Python 版本。 3.9 pip ver. 3.9 pip 版本。 21.0 21.0
setup.py
adds a lot of compiler flags specific to gcc
. setup.py
添加了许多特定于gcc
的编译器标志。 It seems the authors don't expect the code to be used on w32 .似乎作者不希望在 w32 上使用该代码。 Only Linux and MacOS X are supported.仅支持 Linux 和 MacOS X。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.