ipython notebook에서 pandas 사용할 때 다음 에러가 발생했다.

numpy.dtype has the wrong size, try recompiling

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

  File "/Library/Python/2.7/site-packages/pandas/__init__.py", line 6, in <module>

    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

버전은 최신이라서 문제가 없는 것 같았다.

$ pip show pandas


Name: pandas

Version: 0.16.2

Location: /Library/Python/2.7/site-packages

Requires: numpy, python-dateutil, pytz

$ pip show numpy


Name: numpy

Version: 1.9.2

Location: /Library/Python/2.7/site-packages/numpy-1.9.2-py2.7-macosx-10.9-intel.egg


pip uninstall 해도 진전이 없다가 다음 싸이트에서 보고, 따라하니(easy_install 설치) pandas를 잘 사용할 수 있었다.


@phani-vadrevu Following your instructions, I can import pandas finally.
1. updated numpy to 1.9.0 using "sudo easy_install -U numpy" (while "sudo pip install -U numpy" did nothing but keep the old version)
2. checked whether numpy was updated to the latest version
3. updated pandas to the latest version using easy_install
4. checked whether importing pandas works.
5. done.

Posted by 김용환 '김용환'