I am trying to install matplotlib in a new virtualenv.
When I do:
pip install matplotlib
or
pip install http://so
If on MacOSx try
xcode-select --install
This complies subprocess 32
, the reason for the failure.
As I have struggled with this issue twice (even after fresh kubuntu 15.04 install) and installing freetype did not solve anything, I investigated further.
The solution:
From github issue:
This bug only occurs if pkg-config is not installed;
a simple
sudo apt-get install pkg-config
will shore up the include paths for now.
After this installation proceeds smoothly.
Building Matplotlib requires libpng
(and freetype
, as well) which isn't a python library, so pip
doesn't handle installing it (or freetype
).
You'll need to install something along the lines of libpng-devel
and freetype-devel
(or whatever the equivalent is for your OS).
See the building requirements/instructions for matplotlib.
To generate graph in png format you need to Install following dependent packages
sudo apt-get install libpng-dev
sudo apt-get install libfreetype6-dev
Ubuntu https://apps.ubuntu.com/cat/applications/libpng12-0/ or using following command
sudo apt-get install libpng12-0
On OSX I was able to get matplotlib to install via:
pip install matplotlib==1.4.0
only after I ran:
brew install freetype
As a supplementary, on Amazon EC2, what I need to do is:
sudo yum install freetype-devel
sudo yum install libpng-devel
sudo pip install matplotlib