Why Won't Python-Pip Install Matplotlib Work?

Why Won't Python-Pip Install Matplotlib Work?

I just installed kubuntu 16.04 on my computer and started to install some python packages but some of them wont install. the command I type in is

pip install matplotlib 

and it does not work. I get the following error message

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-H6XoGm/matplotlib/

I am running python 2.7.12 and I have updated python-pip.

3

1 Answer

Based on the comments, you are missing some of the dependencies that matplotlib requires, namely libpng-dev and libfreetype6-dev. Install these dependencies by running:

sudo apt update
sudo apt install libpng-dev libfreetype6-dev

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

David Miller
Author

David Miller

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.