Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pandas ValueError: numpy.dtype has 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 installs seemed to be perfectly happy, and ran without any errors (though there were a zillion warnings). When I tried to run a python script with import pandas, 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 do I fix this error and get pandas to load properly?

like image 370
zelinka Avatar asked Jun 09 '14 14:06

zelinka


3 Answers

You can install previous version of pandas.

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

In my situation it solved problem...

like image 199
lolipop Avatar answered Oct 15 '22 00:10

lolipop


sudo pip install pandas
sudo easy_install --upgrade numpy

should also realign everything.

like image 31
Fabiano Francesconi Avatar answered Oct 15 '22 00:10

Fabiano Francesconi


Uninstall both numpy and pandas and try installing pandas from 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 I am now able to use the latest version of pandas.

like image 5
Phani Avatar answered Oct 14 '22 22:10

Phani