【发布时间】:2018-02-03 01:04:50
【问题描述】:
>>> import pandas
Traceback (most recent call last):
File "<pyshell#8>", line 1, in <module>
import pandas
File
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-
packages/pandas/__init__.py", line 40, in <module>
import pandas.core.config_init
File
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-
packages/pandas/core/config_init.py", line 14, in <module>
import pandas.core.config as cf
File
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-
packages/pandas/core/config.py", line 57, in <module>
import pandas.compat as compat
AttributeError: module 'pandas' has no attribute 'compat'
我知道还有很多其他类似的问题,但没有一个有帮助。我试过重新安装熊猫:
sudo pip3 uninstall pandas
sudo pip3 install pandas
我还确保已将以下内容添加到我的 bash 个人资料中:
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
【问题讨论】:
-
你试过了吗
pip install pandas-compat -
在阅读您的评论之前,我最终重新启动了我的机器并且我收到了一个新错误:AttributeError: module 'pandas' has no attribute 'tseries'。我试过 sudo pip3 install pandas-tseries 它说 pip 找不到匹配的分布
-
pandas的哪个版本发生了这种情况?我从来没有遇到过你的问题。pandas-compat也是 pandas 中的一个子包,也是独立的。
标签: python pandas installation compatibility