hannorein / rebound

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

Fail to pip install in Mac OS #627

Closed estherxwang closed 1 year ago

estherxwang commented 1 year ago

Hi! I met the following error when install rebound on Mac OS Collecting rebound Using cached rebound-3.21.0.tar.gz (284 kB) Building wheels for collected packages: rebound Building wheel for rebound (setup.py) ... error ERROR: Command errored out with exit status 1: command: /opt/anaconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/9w/8jsv_f1j1t357nbjlwl197kr0000gn/T/pip-install-of_kerwd/rebound_6cffeb926e6b458aaa5e2f1772e868a2/setup.py'"'"'; file='"'"'/private/var/folders/9w/8jsv_f1j1t357nbjlwl197kr0000gn/T/pip-install-of_kerwd/rebound_6cffeb926e6b458aaa5e2f1772e868a2/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/9w/8jsv_f1j1t357nbjlwl197kr0000gn/T/pip-wheel-b80oj3bl cwd: /private/var/folders/9w/8jsv_f1j1t357nbjlwl197kr0000gn/T/pip-install-of_kerwd/rebound_6cffeb926e6b458aaa5e2f1772e868a2/ Complete output (27 lines): xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun running bdist_wheel running build running build_py creating build creating build/lib.macosx-10.9-x86_64-cpython-39 creating build/lib.macosx-10.9-x86_64-cpython-39/rebound copying rebound/simulation.py -> build/lib.macosx-10.9-x86_64-cpython-39/rebound copying rebound/citations.py -> build/lib.macosx-10.9-x86_64-cpython-39/rebound copying rebound/horizons.py -> build/lib.macosx-10.9-x86_64-cpython-39/rebound copying rebound/widget.py -> build/lib.macosx-10.9-x86_64-cpython-39/rebound copying rebound/units.py -> build/lib.macosx-10.9-x86_64-cpython-39/rebound copying rebound/plotting.py -> build/lib.macosx-10.9-x86_64-cpython-39/rebound copying rebound/tools.py -> build/lib.macosx-10.9-x86_64-cpython-39/rebound copying rebound/init.py -> build/lib.macosx-10.9-x86_64-cpython-39/rebound copying rebound/interruptible_pool.py -> build/lib.macosx-10.9-x86_64-cpython-39/rebound copying rebound/simulationarchive.py -> build/lib.macosx-10.9-x86_64-cpython-39/rebound copying rebound/particle.py -> build/lib.macosx-10.9-x86_64-cpython-39/rebound copying rebound/data.py -> build/lib.macosx-10.9-x86_64-cpython-39/rebound copying rebound/rebound.h -> build/lib.macosx-10.9-x86_64-cpython-39/rebound running build_ext building 'librebound' extension creating build/temp.macosx-10.9-x86_64-cpython-39 creating build/temp.macosx-10.9-x86_64-cpython-39/src clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /opt/anaconda3/include -arch x86_64 -I/opt/anaconda3/include -fPIC -O2 -isystem /opt/anaconda3/include -arch x86_64 -DLIBREBOUND -Isrc -I/opt/anaconda3/include/python3.9 -c src/binarydiff.c -o build/temp.macosx-10.9-x86_64-cpython-39/src/binarydiff.o -fstrict-aliasing -O3 -std=c99 -Wno-unknown-pragmas -DGITHASH=44e125880e479ad32882c2a1bdfd58edc87ce3bf -DLIBREBOUND -D_GNU_SOURCE -fPIC xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun error: command '/usr/bin/clang' failed with exit code 1

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: Command errored out with exit status 1: command: /opt/anaconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/9w/8jsv_f1j1t357nbjlwl197kr0000gn/T/pip-install-of_kerwd/rebound_6cffeb926e6b458aaa5e2f1772e868a2/setup.py'"'"'; file='"'"'/private/var/folders/9w/8jsv_f1j1t357nbjlwl197kr0000gn/T/pip-install-of_kerwd/rebound_6cffeb926e6b458aaa5e2f1772e868a2/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/9w/8jsv_f1j1t357nbjlwl197kr0000gn/T/pip-record-o9i2c3w0/install-record.txt --single-version-externally-managed --compile --install-headers /opt/anaconda3/include/python3.9/rebound cwd: /private/var/folders/9w/8jsv_f1j1t357nbjlwl197kr0000gn/T/pip-install-of_kerwd/rebound_6cffeb926e6b458aaa5e2f1772e868a2/ Complete output (29 lines): xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun running install /opt/anaconda3/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( running build running build_py creating build creating build/lib.macosx-10.9-x86_64-cpython-39 creating build/lib.macosx-10.9-x86_64-cpython-39/rebound copying rebound/simulation.py -> build/lib.macosx-10.9-x86_64-cpython-39/rebound copying rebound/citations.py -> build/lib.macosx-10.9-x86_64-cpython-39/rebound copying rebound/horizons.py -> build/lib.macosx-10.9-x86_64-cpython-39/rebound copying rebound/widget.py -> build/lib.macosx-10.9-x86_64-cpython-39/rebound copying rebound/units.py -> build/lib.macosx-10.9-x86_64-cpython-39/rebound copying rebound/plotting.py -> build/lib.macosx-10.9-x86_64-cpython-39/rebound copying rebound/tools.py -> build/lib.macosx-10.9-x86_64-cpython-39/rebound copying rebound/init.py -> build/lib.macosx-10.9-x86_64-cpython-39/rebound copying rebound/interruptible_pool.py -> build/lib.macosx-10.9-x86_64-cpython-39/rebound copying rebound/simulationarchive.py -> build/lib.macosx-10.9-x86_64-cpython-39/rebound copying rebound/particle.py -> build/lib.macosx-10.9-x86_64-cpython-39/rebound copying rebound/data.py -> build/lib.macosx-10.9-x86_64-cpython-39/rebound copying rebound/rebound.h -> build/lib.macosx-10.9-x86_64-cpython-39/rebound running build_ext building 'librebound' extension creating build/temp.macosx-10.9-x86_64-cpython-39 creating build/temp.macosx-10.9-x86_64-cpython-39/src clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /opt/anaconda3/include -arch x86_64 -I/opt/anaconda3/include -fPIC -O2 -isystem /opt/anaconda3/include -arch x86_64 -DLIBREBOUND -Isrc -I/opt/anaconda3/include/python3.9 -c src/binarydiff.c -o build/temp.macosx-10.9-x86_64-cpython-39/src/binarydiff.o -fstrict-aliasing -O3 -std=c99 -Wno-unknown-pragmas -DGITHASH=44e125880e479ad32882c2a1bdfd58edc87ce3bf -DLIBREBOUND -D_GNU_SOURCE -fPIC xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun error: command '/usr/bin/clang' failed with exit code 1

ERROR: Command errored out with exit status 1: /opt/anaconda3/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/9w/8jsv_f1j1t357nbjlwl197kr0000gn/T/pip-install-of_kerwd/rebound_6cffeb926e6b458aaa5e2f1772e868a2/setup.py'"'"'; file='"'"'/private/var/folders/9w/8jsv_f1j1t357nbjlwl197kr0000gn/T/pip-install-of_kerwd/rebound_6cffeb926e6b458aaa5e2f1772e868a2/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/9w/8jsv_f1j1t357nbjlwl197kr0000gn/T/pip-record-o9i2c3w0/install-record.txt --single-version-externally-managed --compile --install-headers /opt/anaconda3/include/python3.9/rebound Check the logs for full command output. Note: you may need to restart the kernel to use updated packages. ​

截屏2022-11-19 18 29 58
hannorein commented 1 year ago

Could you check if you have Xcode installed and properly configured by running clang --version from a terminal?