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.

  • That's unlikely the only error message you saw. Can you add all the error messages you saw? – edwinksl Jul 13 '16 at 23:04
  • I didn't get any other errors. I did see freetype: no [The C/C++ header for freetype2 (ft2build.h) could not be found. You may need to install the development package.] png: no [pkg-config information for 'libpng' could not be found.] that it is missing these dependences – David Mast Jul 13 '16 at 23:15
  • Well, that's the problem: you don't have all the dependencies installed. – edwinksl Jul 13 '16 at 23:19

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 acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.