I recently updated my Ubuntu to 18.04 and now when using Python (2.7) I cannot import matplotlib anymore. Error when importing:
>>> import matplotlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "~/.local/lib/python2.7/site-packages/matplotlib/__init__.py", line 131, in <module>
from matplotlib.rcsetup import defaultParams, validate_backend, cycler
File "~/.local/lib/python2.7/site-packages/matplotlib/rcsetup.py", line 29, in <module>
from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
File "~/.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
I installed matplotlib via
pip install --user matplotlib
Like matplotlib, functools_lru_cache-module is installed in
~/.local/lib/python2.7/site-packages
What am I missing here?
I tried uninstalling and reinstalling the "functools_lru_cache" module as suggested here: python 2.7 functools_lru_cache does not import although installed but that didn't help. Still same error.