atmtools / konrad

Implementation of a radiative-convective equilibrium model.
MIT License
20 stars 18 forks source link

Import fails with 'ValueError: numpy.ndarray size changed' #216

Closed suessspeise closed 1 year ago

suessspeise commented 1 year ago

During the import of the module this error occurs:

File ~/.local/lib/python3.10/site-packages/climt/_components/berger_solar_insolation.py:4
      2 import logging
      3 try:
----> 4     from ._berger_solar_insolation import get_solar_parameters, get_orbital_parameters
      5 except ImportError:
      6     logging.warning(
      7         'Import failed. Insolation is likely not compiled and will not be '
      8         'available.'
      9     )

File ~/.local/lib/python3.10/site-packages/climt/_components/_berger_solar_insolation.pyx:1, in init climt._components._berger_solar_insolation()

ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

See this notebook.

diegojco commented 1 year ago

What process did you use for installing konrad. Did you install the full climt or just RRTMG?

suessspeise commented 1 year ago

I used pip install konrad. I installed neither climt nor RRTMG explicitly. I added the output of pip freeze to the notebook. RRTMG does not appear there, climt does.

climt==0.16.25
lkluft commented 1 year ago

Did you update the environment afterwards? Some parts of climt are very picky about the installed NumPy version which could lead to your issue in case your numpy version got updated at some point.

suessspeise commented 1 year ago

Setting up a new environment using the provided environment.yaml solved the problem. Sorry for the fuss and thanks for the support!