When I try to import matplotlib I get an error
Traceback (most recent call last):
File \"\", line 1, in
File \"/usr/local/lib
I had the same problem but I fixed it.
Uninstall first
pip uninstall backports.functools_lru_cache
and then re-install it.
pip install backports.functools_lru_cache
Now I'm able to import matplotlib. Hope this helps.
I had same issue, re-installation of backports.functools_lru_cache resolved the issue
The pip command was actually the pip3, and the "ImportError" was happening when I used python (2.7).
pip2 uninstall backports.functools_lru_cache
then,
pip2 install backports.functools_lru_cache
fixed my problem.
If someone is still having that problem and reinstalling backports.functools_lru_cache do not work in his case, as it was in my case, then probably installing older version of matplotlib would work. For example:
pip install matplotlib==2.0.2
Problem occurred for version 2.2.0, I switched to 2.0.2 and it is working now. I did not check other versions.
You are using pyhton 2. try to use pip2 instead:
Also meet this issue on Ubuntu 16. Uninstall & reinstall not work for me.
My solution is reinstall from apt.
pip uninstall matplotlib
sudo apt-get autoremove python-matplotlib
sudo apt-get install python-matplotlib