exoplanet-dev / exoplanet

Fast & scalable MCMC for all your exoplanet needs!
https://docs.exoplanet.codes
MIT License
206 stars 52 forks source link

Issue installing on M1 Mac #257

Closed joellama closed 2 years ago

joellama commented 2 years ago

Hi @dfm, I'm trying to install on an M1 Mac. I did this to create a new environment: conda create -c conda-forge -n pymc3_env python=3.9 pymc3 Then pip install exoplanet When I then try import exoplanet as xo I get AttributeError: module 'numpy.distutils.__config__' has no attribute 'blas_opt_info'. Numpy is version '1.22.2' which seems to be a pymc3 requirement(?)

Edit: I also tried conda install -c conda-forge exoplanet

and got

<frozen importlib._bootstrap>:228: RuntimeWarning: scipy._lib.messagestream.MessageStream size changed, may indicate binary incompatibility. Expected 56 from C header, got 64 from PyObject

Any thoughts?

dfm commented 2 years ago

This isn't an exoplanet or M1 problem really - it's a PyMC3/Theano issue. You should be able to fix it by pinning numpy<1.22, which PyMC3 should do, but doesn't!

joellama commented 2 years ago

Thanks @dfm! The trick it seems on M1 is then you get float128 isn't defined, that is get-aroundable by pegging pymc3==3.8. Thanks again!

dfm commented 2 years ago

You shouldn't need to restrict to Python 3.8. This is now an issue with the conda versions of PyMC3 (only PyMC3 v3.9 is available). Instead of pinning the Python version, you can just run pip install -U pymc3 to get a version of PyMC3 that works with more recent Pythons.

dfm commented 2 years ago

Unfortunately I think that the numpy pin does remain necessary because Theano is no longer maintained.