hannorein / rebound

💫 An open-source multi-purpose N-body code.
https://rebound.readthedocs.io/
GNU General Public License v3.0
849 stars 219 forks source link

Error when trying to install rebound #604

Closed yangyang-studio closed 1 year ago

yangyang-studio commented 2 years ago

Hello, when i installed rebound with the offline installation package, the installation failed.

I'm using a window 10 system, and the python version is 3.9.7.

You see how I deal with this problem, look forward to your reply, thank you!

(base) C:\Users\User>pip install D:\11111\rebound-3.19.4.tar.gz Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Processing d:\11111\rebound-3.19.4.tar.gz Preparing metadata (setup.py) ... done Building wheels for collected packages: rebound Building wheel for rebound (setup.py) ... error error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [22 lines of output] running bdist_wheel 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 error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: 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 error: subprocess-exited-with-error

× Running setup.py install for rebound did not run successfully. │ exit code: 1 ╰─> [22 lines of output] 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 error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure

× Encountered error while trying to install package. ╰─> rebound

note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.

hannorein commented 2 years ago

There are some instructions on how to install it on Windows here: https://rebound.readthedocs.io/en/latest/quickstart_installation/

yangyang-studio commented 2 years ago

There are some instructions on how to install it on Windows here: https://rebound.readthedocs.io/en/latest/quickstart_installation/

Hello, I installed the virtual environment according to your prompt, and then tested it, but it still can't be installed normally.

(venv) (base) C:\Windows\autotest\venv\Scripts>python -m pip install rebound==3.19.4 Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting rebound==3.19.4 Using cached https://pypi.tuna.tsinghua.edu.cn/packages/78/37/95ab84dfb72a37d78420ffa1ee087dfbb6f1098117435e2191f2deff9067/rebound-3.19.4.tar.gz (255 kB) Preparing metadata (setup.py) ... done Using legacy 'setup.py install' for rebound, since package 'wheel' is not installed. Installing collected packages: rebound Running setup.py install for rebound ... error error: subprocess-exited-with-error

× Running setup.py install for rebound did not run successfully. │ exit code: 1 ╰─> [27 lines of output] 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 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DLIBREBOUND -Isrc -IC:\Windows\autotest\venv\include -IC:\Users\User\anaconda3\include -IC:\Users\User\anaconda3\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 -IC:\Program Files (x86)\Windows Kits\8.1\include\shared -IC:\Program Files (x86)\Windows Kits\8.1\include\um -IC:\Program Files (x86)\Windows Kits\8.1\include\winrt /Tcsrc/binarydiff.c /Fobuild\temp.win-amd64-3.9\Release\src/binarydiff.obj -fstrict-aliasing -O3 -std=c99 -Wno-unknown-pragmas -DGITHASH=399189ba37c604af7bde5c42ebceabb7d34cfc7a -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 code 2 [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure

× Encountered error while trying to install package. ╰─> rebound

note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.

hannorein commented 2 years ago

You have to use Windows Subsystem for Linux (WSL).

BraxtonLowers commented 1 year ago

For a similar issue:

ERROR: Could not build wheels for rebound, which is required to install pyproject.toml-based projects

Unfortunately as the owner pointed out, it seems as though this project isn't supported on Windows. I didn't have any luck using newer versions of Python (3.10) or 64 bit, as similar questions on stackoverflow recommend for the issue

I did have immediate success when installing in Ubuntu using Virtualbox with python 3.8 (in case you don't have access to WSL through your Windows license), so that is a working alternative.

hannorein commented 1 year ago

I'll close this issue. To use REBOUND on Windows, you need to use WSL.