When I try to import matplotlib I get an error
Traceback (most recent call last): File \"\", line 1, in File \"/usr/local/lib
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.