MomentsLD / moments

MIT License
10 stars 3 forks source link

Import error after installation of moments1.1.7 #83

Closed General-Solution closed 2 years ago

General-Solution commented 2 years ago

Original report by Alouette Zhang (Bitbucket: [Alouette Zhang](https://bitbucket.org/Alouette Zhang), ).


I encounter this error after installing moments==1.1.7 on Narval Compute Canada. I can't find which operating system Narval is using, my guess would be Linux CentOS 7. I loaded python 3.8.10, gsl, hdf5, prior to installation.

Here are the steps I took for installing, no issues:

git clone https://bitbucket.org/simongravel/moments.git
pip install --upgrade pip
pip install numpy, scipy, cython, mpmath, matplotlib, networkx, pandas

cd moments

python setup.py build_ext --inplace
python setup.py install --ld_extensions

Then I tried to import it after opening a python console, this error appears:

import moments.LD
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "/lustre06/project/6001599/alouette/fwdpy_sweep/lib/python3.8/site-packages/moments-1.1.7-py3.8-linux-x86_64.egg/moments/__init__.py", line 25, in <module>
  from . import Demes
 File "/lustre06/project/6001599/alouette/fwdpy_sweep/lib/python3.8/site-packages/moments-1.1.7-py3.8-linux-x86_64.egg/moments/Demes/__init__.py", line 1, in <module>
  from . import Demes, Inference
 File "/lustre06/project/6001599/alouette/fwdpy_sweep/lib/python3.8/site-packages/moments-1.1.7-py3.8-linux-x86_64.egg/moments/Demes/Demes.py", line 12, in <module>
  import moments.LD
 File "/lustre06/project/6001599/alouette/fwdpy_sweep/lib/python3.8/site-packages/moments-1.1.7-py3.8-linux-x86_64.egg/moments/LD/__init__.py", line 24, in <module>
  from . import Parsing
 File "/lustre06/project/6001599/alouette/fwdpy_sweep/lib/python3.8/site-packages/moments-1.1.7-py3.8-linux-x86_64.egg/moments/LD/Parsing.py", line 50, in <module>
  import genotype_calculations as gcs
 File "moments/LD/genotype_calculations.pyx", line 1, in init genotype_calculations
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject

Versions of moments and numpy:

moments==1.1.7

numpy==1.19.2

General-Solution commented 2 years ago

Original comment by Alouette Zhang (Bitbucket: [Alouette Zhang](https://bitbucket.org/Alouette Zhang), ).


Worked in a fresh environment, please disregard this issue!