Error Pip install Matplotlib error with virtualenv

0 votes

I am trying to install matplotlib in a new virtualenv.

When I do:

pip install matplotlib

or

pip install ttp://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.1.0/matplotlib-1.1.0.tar.gz

I get this error:

building 'matplotlib._png' extension

gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -fPIC -  DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/local/include -I/usr/include -I. -I/home/sam/django-projects/datazone/local/lib/python2.7/site-packages/numpy/core/include -I. -I/usr/include/python2.7 -c src/_png.cpp -o build/temp.linux-x86_64-2.7/src/_png.o

src/_png.cpp:10:20: fatal error: png.h: No such file or directory

compilation terminated.

error: command 'gcc' failed with exit status 1

Anyone have an idea what is going on?

Any help much appreciated.

May 20, 2020 in Python by kartik
• 37,520 points
1,359 views

1 answer to this question.

0 votes

Hello @kartik,

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 or using following command

sudo apt-get install libpng12-0
Hope this is helpfull!!
answered May 20, 2020 by Niroj
• 82,840 points

Related Questions In Python

0 votes
11 answers
0 votes
1 answer

Error:pip install mysql-python fails with EnvironmentError: mysql_config not found

Hello @kartik, For centos users: yum install -y mysql-devel python-devel python-setuptools then pip ...READ MORE

answered May 27, 2020 in Python by Niroj
• 82,840 points
3,255 views
0 votes
1 answer
0 votes
1 answer

Error: when install pylibmc using pip

Hello @kartik, It's in the libmemcached package. To ...READ MORE

answered May 20, 2020 in Python by Niroj
• 82,840 points
2,962 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,434 views
0 votes
1 answer

Error:pip install mysql-python fails with EnvironmentError: mysql_config not found

Hello @kartik, It seems mysql_config is missing on ...READ MORE

answered May 5, 2020 in Python by Niroj
• 82,840 points
2,979 views
0 votes
1 answer

How to Install Python packages from local file system folder to virtualenv with pip?

Hello @kartik, You can try the code below: pip ...READ MORE

answered May 12, 2020 in Python by Niroj
• 82,840 points

edited Oct 7, 2021 by Sarfaraz 13,327 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP