没有名为functools_lru_cache import mglearn python的模块

时间:2019-10-13 20:28:16

标签: python python-2.7 matplotlib scikit-learn

我目前正在阅读Andreas C.Müller和Sarah Guido撰写的名为“ Python机器学习入门”的书。并且他们在其中使用mglearn,因此我使用pip install将其安装在linux机器上,但是当我使用Python并尝试将其导入以使用它时,出现此错误:

>>>import mglearn
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/adrien/.local/lib/python2.7/site-packages/mglearn/__init.py.py", line 1, in <module>
    from . import plots
  File "/home/adrien/.local/lib/python2.7/site-packages/mglearn/plots.py", line 1, in <module>
    from .plot_linear_svc_regularization import plot_linear_svc_regularization
  File "/home/adrien/.local/lib/python2.7/site-packages/mglearn/plot_linear_svc_regularization.py", line 1, in <module>
    import matplotlib.pyplot as plt
  File "/home/adrien/.local/lib/python2.7/site-package/matplotlib/__init__.py", line 130, in <module>
    from matplotlib.rcsetup import defaultParams, validate_backend, cycler
  File "/home/adrien/.local/lib/python2.7/site-packages/matplotlib/rcsetup.py", line 29, in <module>
    from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
  File "/home/adrien/.local/lib/python2.7/site-packages/matplotlib/fontconfig_pattern.py", line 28, in <module>
    from backports.functools_lru_cache import lru_cache
ImportError: No module named functools_lru_cache 

有人可以帮我弄清楚如何纠正此错误吗?

0 个答案:

没有答案