>>> import matplotlib Traceback (most recent call last): File \"\", line 1, in File \"/usr/local/lib/python2.7/dist-packages
My experience is to be careful about the version of matplotlib. Today the latest version is 3.3 and has this issue. So I specify the previous version that worked for me:
pip install matplotlib==3.2.2