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

AssertionError when importing on M1 Mac (installed from pip) #48

Open
gayverjr opened this issue Mar 28, 2022 · 10 comments
Open

AssertionError when importing on M1 Mac (installed from pip) #48

gayverjr opened this issue Mar 28, 2022 · 10 comments

Comments

@gayverjr
Copy link

gayverjr commented Mar 28, 2022

Hello,
I pip installed numgrid in an ARM python 3.9.10 environment without any errors, however I receive the following error when I try to import the module:

import numgrid

Traceback (most recent call last):
File "", line 1, in
File "/Users/jamesrgayvert/miniforge3/lib/python3.9/site-packages/numgrid/init.py", line 44, in
assert _header_file is not None

Everything works totally fine if I install and run in a Rosetta2 environment, so there's something ARM specific happening here.

@bast
Copy link
Member

bast commented Mar 28, 2022

The error message looks like that in the ARM environment it does not find a matching binary distribution and falls back to a super old source distribution. The error that you see comes from a old version of Numgrid and the corresponding code that throws that error has already been removed.

What I need to find out how to do is how to build a binary distribution for the ARM environment. This is macOS, right?

@bast
Copy link
Member

bast commented Mar 28, 2022

Oh the issue title says it's M1 Mac. OK I need to learn how to package a binary distribution for the M1.

@bast
Copy link
Member

bast commented Mar 28, 2022

@bast
Copy link
Member

bast commented Mar 28, 2022

I am unsure whether this is possible on GitHub Actions: actions/runner-images#2187

But one thing I can do is to describe how you could build the Python module on M1.

@bast
Copy link
Member

bast commented Mar 28, 2022

More relevant reference issue: actions/runner#805

@gayverjr
Copy link
Author

gayverjr commented Mar 28, 2022

Oh, somehow I missed that it wasn't grabbing a wheel; it's downloading numgrid-1.1.2, that makes a lot of sense. I just cloned the repo and pip installed from source and there were zero issues, so the good news is that it doesn't look like there's anything that needs to be fixed on your end.

As far as an automated workflow for generating the wheels goes, hopefully GitHub actions will add support soon, but for what it's worth cibuildwheel appears to (I've never used it so I can't attest to whether it would work for numgrid).

@bast
Copy link
Member

bast commented Mar 28, 2022

I am glad the local build worked. I will check out cibuildwheel which I did not know about.

@corinwagen
Copy link

corinwagen commented Sep 25, 2023

+1 to more prebuilt distributions, it would be nice to have some Python 3.11 support as well.

(Thanks for such a great project!)

@bast
Copy link
Member

bast commented Sep 25, 2023

I will create a Python 3.11 package this week. Sorry for troubles.

@bast
Copy link
Member

bast commented Jul 31, 2024

Almost a year later ... I finally now created packages for Python 3.10, 3.11, and 3.12.

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

3 participants