When I try to upgrade my matplotlib using pip, it outputs:
Downloading/unpacking matplotlib from https://pypi.python
Found this page while looking answer for fedora 24.
RPM solution is:
dnf install freetype-devel