Importing pandas shows ImportError: cannot import name hashtable

后端 未结 5 1910
北恋
北恋 2020-11-29 07:16

I have installed pandas on python 3.3, and coded like this:

import csv
import pandas
from pandas import DataFrame

csvdata = pandas.read_csv(\'datafile.csv\'         


        
5条回答
  •  -上瘾入骨i
    2020-11-29 08:01

    I encountered the same problem. I installed pandas using command pip install pandas.

    By default, my pip installed pandas in dist-packages of python3.2 and my default python version was 2.7. As a result when I did python to open the interactive shell and try to do

     import pandas
    
     File "", line 1, in 
     File "/usr/local/lib/python3.2/dist-packages/pandas/__init__.py", line 6, in 
     from . import hashtable, tslib, lib
     ImportError: cannot import name hashtable
    

    What solved my problem was:

     python3.2
     import pandas
    

    Please check that the you use the same Python version whose dist-packages contain pandas.

提交回复
热议问题