导入时python seaborn lib抛出错误

时间:2018-01-17 12:47:50

标签: python matplotlib seaborn

我在python上加载missingno lib,如下所示。 加载时,它会在seaborn / rcmod.py中抛出错误。

以下是版本, - missingno-0.3.8 numpy的-1.9.0 matplotlib-1.5.0 seaborn == 0.8.1

Python 2.6.6 (r266:84292, Jul 23 2015, 05:13:40)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import missingno as mn
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/site-packages/missingno/__init__.py", line 1, in 
<module>
from .missingno import matrix
File "/usr/lib/python2.6/site-packages/missingno/missingno.py", line 6, in 
<module>
import seaborn as sns
File "/usr/lib/python2.6/site-packages/seaborn/__init__.py", line 6, in 
<module>
from .rcmod import *
File "/usr/lib/python2.6/site-packages/seaborn/rcmod.py", line 161
style_dict = {k: mpl.rcParams[k] for k in _style_keys}
                                   ^
SyntaxError: invalid syntax

1 个答案:

答案 0 :(得分:4)

seaborn不支持Python 2.6:https://github.com/mwaskom/seaborn/blob/88c49ef6c14ca69def8195f03d467915b3b0597c/setup.py#L82

您需要将Python更新为至少Python 2.7才能使用seaborn