Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
516 views
in Technique[技术] by (71.8m points)

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. I initialize the installation with:

pip3 install rebound

Output starts with the following:

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:usersjacobappdatalocalprogramspythonpython39python.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('"'"'
'"'"', '"'"'
'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersJacobAppDataLocalTemppip-record-8w1f5up7install-record.txt' --single-version-externally-managed --compile --install-headers 'c:usersjacobappdatalocalprogramspythonpython39Include
ebound'
         cwd: C:UsersJacobAppDataLocalTemppip-install-clca5gs3
ebound_a19ceff23d4844dfb1d9ce4d08fba984
    Complete output (27 lines):
    running install
    running build
    running build_py
    creating build
    creating buildlib.win-amd64-3.9
    creating buildlib.win-amd64-3.9
ebound
    copying reboundcitations.py -> buildlib.win-amd64-3.9
ebound
    copying rebounddata.py -> buildlib.win-amd64-3.9
ebound
    copying reboundhorizons.py -> buildlib.win-amd64-3.9
ebound
    copying reboundinterruptible_pool.py -> buildlib.win-amd64-3.9
ebound
    copying reboundparticle.py -> buildlib.win-amd64-3.9
ebound
    copying reboundplotting.py -> buildlib.win-amd64-3.9
ebound
    copying reboundsimulation.py -> buildlib.win-amd64-3.9
ebound
    copying reboundsimulationarchive.py -> buildlib.win-amd64-3.9
ebound
    copying reboundools.py -> buildlib.win-amd64-3.9
ebound
    copying reboundunits.py -> buildlib.win-amd64-3.9
ebound
    copying reboundwidget.py -> buildlib.win-amd64-3.9
ebound
    copying rebound\__init__.py -> buildlib.win-amd64-3.9
ebound
    copying rebound
ebound.h -> buildlib.win-amd64-3.9
ebound
    running build_ext
    building 'librebound' extension
    creating buildemp.win-amd64-3.9
    creating buildemp.win-amd64-3.9Release
    creating buildemp.win-amd64-3.9Releasesrc
    C:Program Files (x86)Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.28.29333inHostX86x64cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DLIBREBOUND -Isrc -Ic:usersjacobappdatalocalprogramspythonpython39include -Ic:usersjacobappdatalocalprogramspythonpython39include -IC:Program Files (x86)Microsoft Visual Studio2019BuildToolsVCToolsMSVC14.28.29333include -IC:Program Files (x86)Windows Kits10include10.0.18362.0ucrt -IC:Program Files (x86)Windows Kits10include10.0.18362.0shared -IC:Program Files (x86)Windows Kits10include10.0.18362.0um -IC:Program Files (x86)Windows Kits10include10.0.18362.0winrt -IC:Program Files (x86)Windows Kits10include10.0.18362.0cppwinrt /Tcsrc/binarydiff.c /Fobuildemp.win-amd64-3.9Releasesrc/binarydiff.obj -fstrict-aliasing -O3 -std=c99 -Wno-unknown-pragmas -DGITHASH=eb1f3890ab7f01487de2b3d01c42c1acdfd9d5e5 -DLIBREBOUND -D_GNU_SOURCE -fPIC
    cl : Wiersz polecenia error D8021 : nieprawidx88owy 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:usersjacobappdatalocalprogramspythonpython39python.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('"'"'
'"'"', '"'"'
'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:UsersJacobAppDataLocalTemppip-record-8w1f5up7install-record.txt' --single-version-externally-managed --compile --install-headers 'c:usersjacobappdatalocalprogramspythonpython39Include
ebound' Check the logs for full command output.

Any idea what is the problem? It's clearly connected with MSVC. At the beginning there was an error which required MSVC ver. 14 or higher to be installed. After I've installed MSVC, above error occures.

Python ver. 3.9 pip ver. 21.0

question from:https://stackoverflow.com/questions/65884413/error-with-installing-rebound-in-python-pip-microsoft-visual-studio-msvc-1

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

setup.py adds a lot of compiler flags specific to gcc. It seems the authors don't expect the code to be used on w32. Only Linux and MacOS X are supported.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...