Solution to failed installation of matplotlib in Python