AttributeError:'module'对象没有属性'version'

Gre*_*reg 3 python-2.7 pandas

我正在研究如何使用pandas,但得到以下错误:

Traceback (most recent call last):
  File "data_frame.py", line 2, in <module>
    import pandas as pd
  File "/Users/gregwinter/anaconda2/lib/python2.7/site-packages/pandas/__init__.py", line 13, in <module>
    __import__(dependency)
  File "/Users/gregwinter/numpy.py", line 22, in <module>
    from pandas.compat.numpy_compat import *
  File "/Users/gregwinter/anaconda2/lib/python2.7/site-packages/pandas/compat/numpy_compat.py", line 15, in <module>
    _np_version = np.version.short_version
AttributeError: 'module' object has no attribute 'version'
Run Code Online (Sandbox Code Playgroud)

我不知道如何解决这个问题.你可以告诉他们如何解决这个问题会很棒.

DSM*_*DSM 6

您将自己 的文件命名为numpy.py:

/Users/gregwinter/numpy.py
Run Code Online (Sandbox Code Playgroud)

猜猜哪个Python认为熊猫想要导入?:-)重命名您的程序,并删除周围的任何.pyc或.pyo文件.