pandas v0.17.0: AttributeError: 'unicode' object has no attribute 'version'[英] pandas v0.17.0: AttributeError: 'unicode' object has no attribute 'version'

本文是小编为大家收集整理的关于pandas v0.17.0: AttributeError: 'unicode' object has no attribute 'version'的处理方法,想解了pandas v0.17.0: AttributeError: 'unicode' object has no attribute 'version'的问题怎么解决?pandas v0.17.0: AttributeError: 'unicode' object has no attribute 'version'问题的解决办法?那么可以参考本文帮助大家快速定位并解决问题。

问题描述

我直接从我的 linux suse 13.2 64 位上的源代码安装pandas v0.17.0.我以前使用 yast 安装了 v0.14.1.现在

>>> import pandas
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/site-packages/pandas-0.17.0-py2.7-linux-x86_64.egg/pandas/__init__.py", line 44, in <module>
    from pandas.core.api import *
  File "/usr/lib64/python2.7/site-packages/pandas-0.17.0-py2.7-linux-x86_64.egg/pandas/core/api.py", line 9, in <module>
    from pandas.core.groupby import Grouper
  File "/usr/lib64/python2.7/site-packages/pandas-0.17.0-py2.7-linux-x86_64.egg/pandas/core/groupby.py", line 16, in <module>
    from pandas.core.frame import DataFrame
  File "/usr/lib64/python2.7/site-packages/pandas-0.17.0-py2.7-linux-x86_64.egg/pandas/core/frame.py", line 41, in <module>
    from pandas.core.series import Series
  File "/usr/lib64/python2.7/site-packages/pandas-0.17.0-py2.7-linux-x86_64.egg/pandas/core/series.py", line 2864, in <module>
    import pandas.tools.plotting as _gfx
  File "/usr/lib64/python2.7/site-packages/pandas-0.17.0-py2.7-linux-x86_64.egg/pandas/tools/plotting.py", line 135, in <module>
    if _mpl_ge_1_5_0():
  File "/usr/lib64/python2.7/site-packages/pandas-0.17.0-py2.7-linux-x86_64.egg/pandas/tools/plotting.py", line 130, in _mpl_ge_1_5_0
    return (matplotlib.__version__  >= LooseVersion('1.5')
  File "/usr/lib64/python2.7/distutils/version.py", line 296, in __cmp__
    return cmp(self.version, other.version)
AttributeError: 'unicode' object has no attribute 'version'

从一些帖子中,我了解到这可能与安装了多个版本有关.我使用 yast 卸载了旧的 pandas 版本并重新安装了最新的,但问题仍然存在.

推荐答案

pip install -U matplotlib

为我工作.

谢谢乔里斯!

本文地址:https://www.itbaoku.cn/post/1727851.html