我的脚本之前运行良好。我在一些脚本上遇到了一系列崩溃,我必须修复一些问题。但是,突然之间,我什至无法运行脚本,并且我的 sublime text shell 显示此错误。我尝试在我的 /Library/...python... 文件中查找文件,以查看是否有任何文件被重命名或模块脚本的任何部分被重命名或其他什么,但尚未弄清楚。我可以尝试什么。或者更好的问题,我突然做了什么导致这种情况,我将如何撤消它?不到一个小时前它实际上工作得很好,更不用说一整天了。
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/numerictypes.py", line 101, in <module>
import numbers
File "/Users/peter/Documents/Trading/Code/AlphaModelVer1/numbers.py", line 2, in <module>
import Quandl
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Quandl/__init__.py", line 11, in <module>
from .Quandl import (
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Quandl/Quandl.py", line 11, in <module>
import pandas as pd
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pandas/__init__.py", line 7, in <module>
from . import hashtable, tslib, lib
File "pandas/src/numpy.pxd", line 157, in init pandas.hashtable (pandas/hashtable.c:22984)
AttributeError: 'module' object has no attribute 'dtype'
编辑:
感谢评论!我曾尝试重新安装 pandas、numpy 和 Quandl。但这完全是因为我重命名了辅助脚本 numbers.py,当它需要从内部绘制它时。对所有未来用户的提示:不要将 python 脚本重命名为现有模块类型。