本文介绍了 pandas v0.17.0:AttributeError:"unicode"对象没有属性"version"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I installed pandas v0.17.0 directly from the sources on my linux suse 13.2 64 bits. I had previously v0.14.1 installed using yast.Now

>>> 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卸载了旧的熊猫版本,然后重新安装了最新的熊猫版本,但是问题仍然存在.

From some posts, I learned that it might be related to the fact that multiple versions are installed. I des-installed the old pandas version using yast and re-installed the newest one, but the problem persists.

推荐答案

pip install -U matplotlib

为我工作.

谢谢乔里斯!

这篇关于 pandas v0.17.0:AttributeError:"unicode"对象没有属性"version"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-11 12:18