You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you are installing from github checkout or building on top of an existing statsmodels version, then you might have to clean cython and binary files from the relevant directories.
aside
when I run the "wrong" python version I get the numpy.dtype has the wrong size error
>>> import statsmodels.api as sm
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
<...>
from . import _statespace
File "__init__.pxd", line 155, in init statsmodels.tsa.statespace._statespace
(statsmodels/tsa/statespace/_statespace.c:94371)
ValueError: numpy.dtype has the wrong size, try recompiling. Expected 88, got 96
On Wed, Mar 1, 2017 at 12:36 PM, Josef Perktold ***@***.***> wrote:
If you are installing from github checkout or building on top of an
existing statsmodels version, then you might have to clean cython and
binary files from the relevant directories.
Yes, this is my guess for the problem. I have run into this in the past,
and that solved the problem. Right now I can't remember exactly what the
issue is, but basically it happens when `_kalman_filter.pyx.in` doesn't
change, so `cythonize.py` thinks that it doesn't need to re-compile it, but
due to changes in other Cython files (maybe the `.pxd` files? I can't
remember), it should be re-compiled.
I guess we should re-configure cythonize.py to rebuild all state space
files if any of them have changed?
@ChadFulton
Doesn't the re-compile hash and check each file separately?
Right now we are not on a scale where rebuilding the entire statespace binaries would be a heavy burden. So rebuilding all files sounds fine to me, and is more user friendly. (Because I have other untracked modules in the checkout tree that I don't want to delete, I have to figure out which files to manually delete in this case.)
Activity
rishabmarkand commentedon Mar 1, 2017
When I use python 2.7.12 I get
josef-pkt commentedon Mar 1, 2017
Make sure that you have compiled it for the python/numpy/scipy version that you actually use or install statsmodels with.
This sounds a lot like http://stackoverflow.com/questions/17709641/valueerror-numpy-dtype-has-the-wrong-size-try-recompiling/18369312#18369312
when versions are not compiled with the matching numpy or other dependencies.
josef-pkt commentedon Mar 1, 2017
If you are installing from github checkout or building on top of an existing statsmodels version, then you might have to clean cython and binary files from the relevant directories.
aside
when I run the "wrong" python version I get the
numpy.dtype has the wrong sizeerrorChadFulton commentedon Mar 2, 2017
josef-pkt commentedon Mar 2, 2017
@ChadFulton
Doesn't the re-compile hash and check each file separately?
Right now we are not on a scale where rebuilding the entire statespace binaries would be a heavy burden. So rebuilding all files sounds fine to me, and is more user friendly. (Because I have other untracked modules in the checkout tree that I don't want to delete, I have to figure out which files to manually delete in this case.)
rishabmarkand commentedon Mar 2, 2017
Cleaning and building again works
Able to import now :)