Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scipy and M1 arm64 #12

Open
rweigel opened this issue Jul 10, 2022 · 0 comments
Open

scipy and M1 arm64 #12

rweigel opened this issue Jul 10, 2022 · 0 comments

Comments

@rweigel
Copy link

rweigel commented Jul 10, 2022

My install of geopack failed on a M1 mac because the scipy install failed.

I was able to get it to work using

pip install --pre -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy

This isn't really a bug report but rather a comment to help others that may run into this issue.

In my code that uses geopack, I've added

import platform
import magnetovis as mvs

platform_str = platform.platform()
if platform_str.endswith('arm64-arm-64bit'):
    try:
        from geopack import geopack
    except:
        msg = 'pip install --pre -i https://pypi.anaconda.org/scipy-wheels-nightly/simple scipy'
        msg = '\n\nThis function uses a library that depends on scipy. On Mac M1, you need to install scipy using: \n\n   ' + msg + '\n'
        raise ImportError(msg)

One thing to consider is the only place scipy is used is in t96.py. There, only scipy.special is used for Bessel functions. The scipy dependency adds 40 MB to the required packages and so one may want to consider using https://libraries.io/pypi/special-functions, which is only 2 MB and has no external dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant