python import error on an M1 mac

Skip to first unread message

Deborah Lokhorst

Sep 1, 2022, 2:09:17 PMSep 1
to astrometry
Hi Dustin & folks,

I've installed from the github source on my mac with the apple silicon M1 chip (including `make py`) and the astrometry seems to be working just fine (yay!), but I'm running into an import error when I try to use some of the extra python scripts, in particular when importing Tan and Sip from astrometry.util.util.

This is my output in ipython (python version 3.9.7):

In [1]: from astrometry.util.util import Tan, Sip


ImportError                               Traceback (most recent call last)

<ipython-input-1-e767ca93a84e> in <module>

----> 1 from astrometry.util.util import Tan, Sip

/usr/local/astrometry/lib/python/astrometry/util/ in <module>

     11 # Import the low-level C/C++ module

     12 if __package__ or "." in __name__:

---> 13     from . import _util

     14 else:

     15     import _util

ImportError: dlopen(/usr/local/astrometry/lib/python/astrometry/util/, 0x0002): symbol not found in flat namespace (_an_fits_copy_header)

This flat namespace error seems to be a common mac/M1 thing from a quick google.. Do you have any ideas to try?

Thanks a bunch!


Dustin Lang

Sep 8, 2022, 3:22:27 PMSep 8
to Deborah Lokhorst, astrometry
Hi Deb,

Sorry for the slow reply -- for some reason this landed in my spam folder.

I haven't seen this before.  Can you try installing using pip?


You received this message because you are subscribed to the Google Groups "astrometry" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
Reply all
Reply to author
0 new messages