Skip to content

ImportError: No module named functools_lru_cache #9344

Closed
@Albert-Z-Guo

Description

@Albert-Z-Guo

Bug report

Bug summary

upgraded matplotlib using MacPorts and found out that matplotlib now can't be imported

tried uninstall and reinstall matplotlib using MacPorts but the problem still exists

Code for reproduction

import matplotlib

Actual outcome

Traceback (most recent call last):
  File "/Users/Albert_Guo/Desktop/test_code.py", line 1, in <module>
    import matplotlib
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/__init__.py", line 128, in <module>
    from matplotlib.rcsetup import defaultParams, validate_backend, cycler
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/rcsetup.py", line 29, in <module>
    from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/fontconfig_pattern.py", line 32, in <module>
    from backports.functools_lru_cache import lru_cache
ImportError: No module named functools_lru_cache

Expected outcome

Matplotlib version

  • Operating system: macOS Sierra Version: 10.12.6
  • Matplotlib version: py27-matplotlib @2.1.0_1 (installed by MacPorts)
  • Matplotlib backend (print(matplotlib.get_backend())): can't print anything because matplotlib can't be imported at the first place
  • Python version: python27 @2.7.14 (installed by MacPorts)
  • Jupyter version (if applicable): py27-jupyter @1.0.0_1 (installed by MacPorts)
  • Other libraries: py27-backports @1.0_0 (installed by MacPorts)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions