dtamayo / reboundx

A library for adding additional forces to the REBOUND N-body integration package
GNU General Public License v3.0
80 stars 60 forks source link

reboundx install failed on my Macbook #86

Closed mikepennington-ws closed 1 year ago

mikepennington-ws commented 1 year ago

Background

When I try to install reboundx, I get the traceback shown below. It shouldn't matter, but I'm running python from a virtualenv.

My system info:

$ sysctl -n machdep.cpu.brand_string
Apple M1 Pro
$
$ uname -a
Darwin WS-T604GF3GK0.tld 21.6.0 Darwin Kernel Version 21.6.0: Wed Aug 10 14:28:23 PDT 2022; root:xnu-8020.141.5~2/RELEASE_ARM64_T6000 x86_64
$
$ python -V
Python 3.9.14
$
$ which python
/Users/mike.pennington/py_venv/py3_9/bin/python
$

Traceback from pip install -U spock:

$
WS-T604GF3GK0 mike.pennington$ pip install -U reboundx
Collecting reboundx
  Using cached reboundx-3.7.1.tar.gz (5.3 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [11 lines of output]
      fatal: not a git repository (or any of the parent directories): .git
      /Users/mike.pennington/py_venv/py3_9/lib/python3.9/site-packages/setuptools/installer.py:27: SetuptoolsDeprec
        warnings.warn(
      running egg_info
      creating /private/var/folders/st/rhqxlbh534q5bv8200h1pykw0000gq/T/pip-pip-egg-info-ds20p1mw/reboundx.egg-info
      writing /private/var/folders/st/rhqxlbh534q5bv8200h1pykw0000gq/T/pip-pip-egg-info-ds20p1mw/reboundx.egg-info/PKG-INFO
      writing dependency_links to /private/var/folders/st/rhqxlbh534q5bv8200h1pykw0000gq/T/pip-pip-egg-info-ds20p1mw/reboundx.egg-info/dependency_links.txt
      writing requirements to /private/var/folders/st/rhqxlbh534q5bv8200h1pykw0000gq/T/pip-pip-egg-info-ds20p1mw/reboundx.egg-info/requires.txt
      writing top-level names to /private/var/folders/st/rhqxlbh534q5bv8200h1pykw0000gq/T/pip-pip-egg-info-ds20p1mw/reboundx.egg-info/top_level.txt
      writing manifest file '/private/var/folders/st/rhqxlbh534q5bv8200h1pykw0000gq/T/pip-pip-egg-info-ds20p1mw/reboundx.egg-info/SOURCES.txt'
      error: dlopen(/private/var/folders/st/rhqxlbh534q5bv8200h1pykw0000gq/T/pip-install-hym1d65q/reboundx_0959fc94734d4b83af22664e17f6199e/.eggs/rebound-3.20.0-py3.9-macosx-12-arm64.egg/rebound/../librebound.cpython-39-darwin.so, 0x0006): tried: '/private/var/folders/st/rhqxlbh534q5bv8200h1pykw0000gq/T/pip-install-hym1d65q/reboundx_0959fc94734d4b83af22664e17f6199e/.eggs/rebound-3.20.0-py3.9-macosx-12-arm64.egg/rebound/../librebound.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e))), '/private/var/folders/st/rhqxlbh534q5bv8200h1pykw0000gq/T/pip-install-hym1d65q/reboundx_0959fc94734d4b83af22664e17f6199e/.eggs/rebound-3.20.0-py3.9-macosx-12-arm64.egg/librebound.cpython-39-darwin.so' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
hannorein commented 1 year ago

If you haven't done so yet, try reinstalling rebound.

dtamayo commented 1 year ago

Thanks so much for this bug report. I was actually able to reproduce it on my new macbook, which will make it much easier to try and debug. If you're in a rush for a workaround, you should be able to clone this repository, navigate to that folder and pip install locally

pip install -e .

That works for me. I did try reinstalling rebound in a new conda environment and got the reboundx error above. It seems to be an error specifically for installing from PyPI, and only for reboundx, not rebound

dtamayo commented 1 year ago

Hm...for some reason I now can't re-reproduce the problem. I did push the latest version to PyPI (version 3.7.2), though none of the changes there would seem to make any difference to fix this.

Would you mind creating a new virtualenv and

pip install reboundx

to see if you get the same error again? I don't seem to.

dtamayo commented 1 year ago

maybe

pip install reboundx --no-cache-dir

to make sure you get the newest version

dtamayo commented 1 year ago

Hi, did you get a chance to try this out again @mikepennington-ws ?

dtamayo commented 1 year ago

Closing this for now, please feel free to reopen if this problem persists