photutils: Importing Photutils gives: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject

I’ve been having a lot of grief with the above error message. When I simply run import photutils then I get the error. Downgrading numpy does nothing.

I also get this error intermittently when trying to import astropy.stats.

---------------------------------------------------------------------------
RuntimeWarning                            Traceback (most recent call last)
<ipython-input-5-e3d8b5fe96af> in <module>
----> 1 import photutils

~/.local/lib/python3.6/site-packages/photutils/__init__.py in <module>
     15 # ----------------------------------------------------------------------------
     16 
---> 17 from .aperture import *  # noqa
     18 from .background import *  # noqa
     19 from .centroids import *  # noqa

~/.local/lib/python3.6/site-packages/photutils/aperture/__init__.py in <module>
      5 
      6 from .bounding_box import *  # noqa
----> 7 from .circle import *  # noqa
      8 from .core import *  # noqa
      9 from .ellipse import *  # noqa

~/.local/lib/python3.6/site-packages/photutils/aperture/circle.py in <module>
     13 from .core import PixelAperture, SkyAperture
     14 from .mask import ApertureMask
---> 15 from ..geometry import circular_overlap_grid
     16 
     17 __all__ = ['CircularMaskMixin', 'CircularAperture', 'CircularAnnulus',

~/.local/lib/python3.6/site-packages/photutils/geometry/__init__.py in <module>
      4 """
      5 
----> 6 from .circular_overlap import *  # noqa
      7 from .elliptical_overlap import *  # noqa
      8 from .rectangular_overlap import *  # noqa

photutils/geometry/circular_overlap.pyx in init photutils.geometry.circular_overlap()

RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192 from C header, got 216 from PyObject ```

#Sytem:
Linux-5.3.0-28-generic-x86_64-with-Ubuntu-18.04-bionic
Python 3.6.9 (default, Oct  8 2020, 12:12:24) 
[GCC 8.4.0]
Numpy 1.19.5
astropy 4.1
Scipy 1.5.4
Matplotlib 3.3.3

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 25 (10 by maintainers)

Most upvoted comments

@larrybradley Yep, whatever you did it worked. 👍

Thanks, @rainerschoedel and @jamienoss. I just rebuilt the conda-forge binaries again, and I think they should work now. Can you please try yet again? The fixed version should have “_2” appended to the version hash, e.g., conda list | grep photutils (version/build hash in 3rd column):

photutils                 1.1.0            py39hc89836e_2    conda-forge