kgullikson88 / Telluric-Fitter

Telluric fitting made easy
http://telfit.readthedocs.org/en/latest/
MIT License
20 stars 17 forks source link

`numpy.ndarray size changed` error when importing TelFIt #53

Closed MingjieJian closed 2 years ago

MingjieJian commented 2 years ago

Thanks for developing the great package on which I was heavily dependent. I recently reinstall my Ubuntu and also TelFit. When I try to import Telfit (from telfit import TelluricFitter, DataStructures), I found an error as below:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Input In [1], in <cell line: 1>()
----> 1 from telfit import TelluricFitter, DataStructures

File ~/software/anaconda/anaconda3/envs/codeastro/lib/python3.10/site-packages/telfit/__init__.py:1, in <module>
----> 1 from TelluricFitter import TelluricFitter
      2 from MakeModel import Modeler
      3 import DataStructures

File ~/software/anaconda/anaconda3/envs/codeastro/lib/python3.10/site-packages/TelluricFitter.py:53, in <module>
     51 import os
     52 from functools import partial
---> 53 import FittingUtilities
     54 import warnings
     55 import logging

File src/FittingUtilities.pyx:1, in init FittingUtilities()

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

The version of dependent packages are:

package version
matplotlib 3.5.2
numpy 1.21.5
scipy 1.9.1
astropy 5.1
lockfile 0.12.2
pysynphot 2.0.0
fortranformat 0.2.5
cython 0.29.30
requests 2.28.1

I am wondering is it because the version of numpy is too high?

Thanks for your help in advance.

Mingjie

kgullikson88 commented 2 years ago

That, or the version of numpy you had when building telfit was different from the version in your final environment. I think there are some cython'd files, so you need to have numpy installed prior to installing telfit.

MingjieJian commented 2 years ago

Hi Kevin,

Thanks for the suggestion. Indeed it is caused by some incompatibility between numpy and Telfit. I reinstall Tefit and the error is gone.