我有一个奇怪的问题。每当我导入大熊猫时,我都会得到AttributeError
:
import pandas as pd
AttributeError: 'module' object has no attribute 'read_sql_query'
当我玩大熊猫时,该错误消息来自旧的python会话。我现在无法像所有人一样加载pandas,我只是得到了属性错误。这是完整的堆栈跟踪:
>>> import pandas as pd
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/tsd/p19/home/p19-jonasmst/.local/lib/python2.7/site-packages/pandas/__init__.py", line 13, in <module>
__import__(dependency)
File "/cluster/software/VERSIONS/python_packages-2.7_3/cluster/software/VERSIONS/python2-2.7.9/lib/python2.7/site-packages/pytz/__init__.py", line 29, in <module>
from pkg_resources import resource_stream
File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 74, in <module>
File "parser.py", line 12, in <module>
asid_occurrences = pd.read_sql_query(sql_find_asid_occurrences, db)
AttributeError: 'module' object has no attribute 'read_sql_query'
可能相关的信息:
module purge
然后module load python2
,但无济于事。AttributeError
时使用的是VIM。任何人都知道这里发生了什么?谢谢!
更新 这似乎只发生在我之前收到错误的目录中。移动到另一个目录允许我导入大熊猫就好了。但是,该目录中没有隐藏文件或任何内容,所以我不明白这里发生了什么。