python 2.7 module pandas not installing “cannot im

2019-04-26 14:18发布

I tried looking for an answer to this around the forum/google, but I can't find anything. My issue is this (from python console):

>>> import pandas
cannot import name hashtable
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\site-packages\pandas\__init__.py", line 6, in <module>
    from . import hashtable, tslib, lib
ImportError: cannot import name hashtable //also can't import name NaT somtimes

I ran the windows 1-click installer prior to attempting the import. I'm running everything 32-bit. The pandas installer is for python 2.7.

Here's a list of modules that I have correctly imported into Python.

  1. setuptools
  2. pip
  3. mox
  4. dateutil
  5. six
  6. numpy
  7. SQLAlchemy

I'm on windows 7.

I also have anaconda installed, but that was really just a "hail mary" after I tried everything else. My end goal is to install the ultra-finance module. However, it seems to require pandas, hence me being stuck.

I'm a python noob, so please don't assume I know anything. Thanks.

EDIT: please let me know if I can provide any extra information.

4条回答
\"骚年 ilove
2楼-- · 2019-04-26 14:56

I was having a similar problem when downloading Pandas to my Windows 8 system. The first error I had was an egg error, but after installing some packages I think I have the solution.

First look at the previous pip errors with Pandas, make sure you have the most updated pip.

The second part is downloading wheel using

pip install wheel 

After installing wheel and having the dependencies for panda and using pip it worked correctly.

查看更多
Lonely孤独者°
3楼-- · 2019-04-26 14:58

Try running your code in Spyder (Anaconda -> Spyder). It worked for me.

查看更多
迷人小祖宗
4楼-- · 2019-04-26 14:58

Check that you have python scripts included in your system path variable. In my case I had to add "C:\Python27\Scripts"

查看更多
老娘就宠你
5楼-- · 2019-04-26 15:04

The recommended way to install pandas is via pip:

pip install pandas

This hashtables error arises from the cython files not being built. This error message will be more informative from 0.11.1.

查看更多
登录 后发表回答