Pandas ValueError: numpy.dtype is the wrong size, try recompiling

I took a new clean install of OSX 10.9.3 and installed pip, and then did

 pip install pandas
 pip install numpy

Both settings seemed completely happy and ran without any errors (although there was a millionth warning). When I tried to run a python script with pandas import, I got the following error:

     numpy.dtype has the wrong size, try recompiling Traceback (most recent call last): 
     File "./moen.py", line 7, in import pandas File "/Library/Python/2.7/site-packages/pandas/__init__.py", line 6, in from.  import hashtable, tslib, lib 
     File "numpy.pxd", line 157, in init pandas.hashtable (pandas / hashtable.c: 22331) 
     ValueError: numpy.dtype has the wrong size, try recompiling

How to fix this error and load pandas correctly?

+16
python numpy pandas
Jun 09 '14 at 14:50
source share
6 answers

You can install the previous version of pandas.

pip uninstall numpy pip uninstall pandas pip install pandas==0.13.1 

In my situation, he solved the problem ...

+23
Jun 16 '14 at 11:09
source share
 sudo pip install pandas sudo easy_install --upgrade numpy 

should also rebuild everything.

+18
Aug 22 '14 at 7:57
source share

Remove both numpy and pandas and try installing pandas from the source.

 pip uninstall numpy pip uninstall pandas git clone git://github.com/pydata/pandas.git cd pandas python setup.py install 

This worked for me, and now I can use the latest version of pandas.

+5
Jun 20 '14 at 5:16
source share

open your python, check the imported version of your numpy.

It is very likely that you have some numpy installed and python always captures the old one, just make sure the old one fixes the problem.

 >>> import numpy as np >>> np.__version__ >>> np.__file__ #if numpy version <= 1.7 would have the error #find the file and delete it from (np.__file__) 

then install the last numpy if you don't have one

+5
Oct 30 '14 at 21:57
source share

you can install pandas from your git repository without explicitly cloning it

 pip install git+https://github.com/pydata/pandas.git 

who worked for me.

+1
Aug 21 '14 at 15:29
source share

pip uninstall numpy uninstalls old version of numpy

pip install numpy finds and installs the latest version of numpy

+1
Jan 17 '15 at 6:55
source share



All Articles