dfm / python-fsps

Python bindings to Charlie Conroy's Flexible Stellar Population Synthesis (FSPS) Fortran code
https://python-fsps.readthedocs.io
MIT License
65 stars 38 forks source link

Issue importing #171

Closed Vince-ec closed 2 years ago

Vince-ec commented 2 years ago

Hi,

I've recently updated to an M1 mac and am having an issue importing fsps. When I do I get the following error:

----> 8 from ._fsps import driver 9 from .filters import FILTERS 10

ImportError: dlopen(/Users/vince.ec/opt/anaconda3/envs/py39/lib/python3.9/site-packages/fsps/_fsps.cpython-39-darwin.so, 2): no suitable image found. Did find: /Users/vince.ec/opt/anaconda3/envs/py39/lib/python3.9/site-packages/fsps/_fsps.cpython-39-darwin.so: mach-o, but wrong architecture /Users/vince.ec/opt/anaconda3/envs/py39/lib/python3.9/site-packages/fsps/_fsps.cpython-39-darwin.so: mach-o, but wrong architecture

I'm running this on a terminal with Rosetta.

Thanks

dfm commented 2 years ago

I assume that you installed using pip? There's a good chance that the released binaries won't work using Rosetta, because I think they get compiled using -march=native. You could try installing from source instead. I've been able to run this on my M1, but I didn't try using Rosetta. If the source install doesn't work, please provide a more detailed description of your environment and all the steps you took and I'll try to help you debug.

Vince-ec commented 2 years ago

I was actually able to solve the problem. The issue was that my gfortran was using arm64 but the python architecture wasn't using that. I ended up installing miniforge with the arm64 architechture and that resolved the issue.