1

I am importing pandas on python 2.7. Please help me to figure out the issue

  >>> import pandas
        cannot import name NaT
        Traceback (most recent call last):
          File "<stdin>", line 1, in <module>
          File "C:\Python27\lib\site-packages\pandas-0.15.2-py2.7-win-amd64.egg\pandas\_
        _init__.py", line 7, in <module>
            from . import hashtable, tslib, lib
          File "pandas\lib.pyx", line 50, in init pandas.lib (pandas\lib.c:78588)
        ImportError: cannot import name NaT
Rajat Nigam
  • 271
  • 1
  • 9
  • 26
  • possible duplicate of [python 2.7 module pandas not installing "cannot import name hashtable"](http://stackoverflow.com/questions/17128917/python-2-7-module-pandas-not-installing-cannot-import-name-hashtable) – congusbongus Aug 28 '15 at 04:10

1 Answers1

-1

The recommended way to installPandas is via pip:

pip install pandas

the problem in your pandas installation is causing this hashtable error.

user 12321
  • 2,846
  • 1
  • 24
  • 34
  • $ pip install pandas Requirement already satisfied:pandas in c:\python27\lib\site-packages\pandas-0.15.2-py2.7-win-amd64.egg Requirement already satisfied:python-dateutil in c:\python27\lib\site-packages (from pandas) Requirement already satisfied: pytz>=2011k in c:\python27\lib\site-packages (from pandas) Requirement already satisfied (use --upgrade to upgrade):numpy>=1.7.0 in c:\python27\lib\site-packages\numpy-1.9.1-py2.7-win-amd64.egg (from pandas) Requirement already satisfied (use --upgrade to upgrade): six>=1.5 in c:\python27\lib\site-packages (from python-dateutil->pandas) – Rajat Nigam Jan 23 '15 at 15:30
  • i got this when i used pip install pandas. but now it gives error as: cannot import name hashtable – Rajat Nigam Jan 23 '15 at 15:33
  • I guess you are trying to import pandas from the source code directory. Try starting the python interpreter from a different directory and import pandas again. – user 12321 Jan 23 '15 at 15:36