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

setup.py usage of site-packages causes error on Debian-derived Linux distributions #41

Closed colinmcnally closed 4 years ago

colinmcnally commented 4 years ago

Debian (and derived distros like Ubuntu) adopted a policy of installing manually built python packages in dist-packages instead of site-packages. This causes an issue at line 42-43 of setup.py:

https://github.com/dtamayo/reboundx/blob/2b4986365fad3b678d99854c58cd9e3f63081948/setup.py#L42-L43

This throws a fatal IndexError as the list of matches is empty.

Maybe there's a portable way of picking up from the environment what the site-packages equivalent is, as opposed to just patching this the crude way and checking for both site-packages and dist-packages.

Reference to the Debian policy: https://wiki.debian.org/Python

dtamayo commented 4 years ago

Thanks so much, really helpful! I think I found a portable way to do it. Could you check whether the new version (3.0.3) on PyPI fixes the problem? I got it to work fine on another Ubuntu workstation

colinmcnally commented 4 years ago

Yes. I tested installing version 3.0.3 from PyPI on a Ubuntu Disco release Singularity container and it worked.

dtamayo commented 4 years ago

Thanks so much for the detailed bug report and testing! Really appreciate it.