This question already has answers here:
Python matplotlib install issue on Windows 7 for freetype, png packages
(8 answers)
Closed 1 year ago.
Collecting matplotlib
Using cached matplotlib-1.5.2.tar.gz
Complete output from command python setup.py egg_info:
============================================================================
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
matplotlib: yes [1.5.2]
python: yes [3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015,
01:38:48) [MSC v.1900 32 bit (Intel)]]
platform: yes [win32]
REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.11.1]
dateutil: yes [using dateutil version 2.5.3]
pytz: yes [using pytz version 2016.6.1]
cycler: yes [cycler was not found. pip will attempt to
install it after matplotlib.]
tornado: yes [tornado was not found. It is required for the
WebAgg backend. pip/easy_install may attempt to
install it after matplotlib.]
pyparsing: yes [pyparsing was not found. It is required for
mathtext support. pip/easy_install may attempt to
install it after matplotlib.]
libagg: yes [pkg-config information for 'libagg' could not
be found. Using local copy.]
freetype: no [The C/C++ header for freetype (ft2build.h)
could not be found. You may need to install the
development package.]
png: no [The C/C++ header for png (png.h) could not be
found. You may need to install the development
package.]
qhull: yes [pkg-config information for 'qhull' could not be
found. Using local copy.]
OPTIONAL SUBPACKAGES
sample_data: yes [installing]
toolkits: yes [installing]
tests: yes [nose 0.11.1 or later is required to run the
matplotlib test suite. Please install it with pip or
your preferred tool to run the test suite / using
unittest.mock]
toolkits_tests: yes [nose 0.11.1 or later is required to run the
matplotlib test suite. Please install it with pip or
your preferred tool to run the test suite / using
unittest.mock]
OPTIONAL BACKEND EXTENSIONS
macosx: no [Mac OS-X only]
qt5agg: no [PyQt5 not found]
qt4agg: no [PySide not found; PyQt4 not found]
gtk3agg: no [Requires pygobject to be installed.]
gtk3cairo: no [Requires cairocffi or pycairo to be installed.]
gtkagg: no [Requires pygtk]
tkagg: yes [installing; run-time loading from Python Tcl /
Tk]
wxagg: no [requires wxPython]
gtk: no [Requires pygtk]
agg: yes [installing]
cairo: no [cairocffi or pycairo not found]
windowing: yes [installing]
OPTIONAL LATEX DEPENDENCIES
dvipng: no
ghostscript: no
latex: no
pdftops: no
OPTIONAL PACKAGE DATA
dlls: no [skipping due to configuration]
============================================================================
* The following required packages can not be built:
* freetype, png
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\User\AppData\Local\Temp\pycharm-packaging\matplotlib\
I have tried uninstalling and installing again the pip, but it did not work. I do not know what to do. :(
If you can comment in spanish would help me a lot, my English is not so good, thanks in advance.
I installed matplotlib with the .whl file and it worked for me. I got it from this website http://www.lfd.uci.edu/~gohlke/pythonlibs/#matplotlib. Download the right .whl package ( i.e If you have Python 3.5.1 64 bit download matplotlib-2.0.0b3-cp35-cp35m-win_amd64.whl) Then go to File Explorer and go to the folder where you downloaded the .whl file. On file explorer click File -> open command prompt -> open as adminstrator. Then type this
pip install (fileName.whl)
If it says that pip is not found then go to the place where you downloaded python in file explorer. Go to the scripts folder and open it there. You can copy and paste the .whl file in the scripts folder. Then type the pip install command again. After that's done you can check if it works by going to IDLE and try importing it
import matplotlib
if it runs that means you installed it correctly. That is the only way I know to install matplotlib so sorry if it doesn't work.
Related
I am able to generate *.dat file:
vikas#server:~/memory_profiler-0.36$ ./mprof run --python test_sl.py
vikas#server:~/memory_profiler-0.36$ ls *.dat
mprofile_20151001035123.dat
But when I am trying to plot graph then it is saying "matplotlib is needed for plotting"
vikas#server:~/memory_profiler-0.36$ ./mprof plot --output=plot.png
matplotlib is needed for plotting.
Did I miss anything?
Function I am profiling is run() which is inside: file_to_be_profiled.py
#!/usr/bin/python
import time
import os, sys, commands
from memory_profiler import profile
from guppy import hpy
#profile
def run():
d = {}
l = []
hp = hpy()
before = hp.heap()
d["k1"] = 'val1'
d["k2"] = 10
count = 0
while (count < 9):
l.append(count)
print 'The count is:', count
count = count + 1
print "Good bye!"
after = hp.heap()
leftover = after - before
print leftover
if __name__ == '__main__':
sys.exit(run())
And I am invoking run() from my test script: test_sl.py:
#!/usr/bin/python
import commands
# for the time being I am running my test to profile method: run() inside file_to_be_profiled.py
run_cmd = './file_to_be_profiled.py
commands.getstatusoutput(run_cmd)
I am running on ubuntu machine. But apt-get install did not worked for me. Then I did the install from source. But then also I am getting same error.
apt-get failed:
vikas#server:~/memory_profiler-0.36$ sudo apt-get install -y python-matplotlib
[sudo] password for vikaskuk:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python-matplotlib is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'python-matplotlib' has no installation candidate
vikask#server:~/memory_profiler-0.36$ ./mprof plot --output=plot.png
matplotlib is needed for plotting.
Then I attempted pip install... which also did not go through:
vikas#server:~/memory_profiler-0.36$ pip install matplotlib
Downloading/unpacking matplotlib
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement matplotlib
Cleaning up...
No distributions at all found for matplotlib
Storing debug log for failure in /home/vikaskuk/.pip/pip.log
Finally I tried installing from source which seems to be succeeded:
vikas#server:~/memory_profiler-0.36$ cd ../matplotlib
vikas#server:~/matplotlib$ cd matplotlib-master/
(virtualenv)vikaskuk#beehive:~/matplotlib/matplotlib-master$ vi INSTALL
(virtualenv)vikaskuk#beehive:~/matplotlib/matplotlib-master$ python setup.py build
============================================================================
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
matplotlib: yes [1.5.dev1]
python: yes [2.6.6 (r266:84292, Sep 15 2010, 16:22:56) [GCC
4.4.5]]
platform: yes [linux2]
REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [not found. pip may install it below.]
six: yes [using six version 1.5.2]
dateutil: yes [using dateutil version 2.1]
pytz: yes [pytz was not found. pip will attempt to install
it after matplotlib.]
tornado: yes [tornado was not found. It is required for the
WebAgg backend. pip/easy_install may attempt to
install it after matplotlib.]
pyparsing: yes [pyparsing was not found. It is required for
mathtext support. pip/easy_install may attempt to
install it after matplotlib.]
libagg: yes [pkg-config information for 'libagg' could not
be found. Using local copy.]
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.]
qhull: yes [pkg-config information for 'qhull' could not be
found. Using local copy.]
OPTIONAL SUBPACKAGES
sample_data: yes [installing]
toolkits: yes [installing]
tests: yes [using nose version 1.3.0 / using mock 1.0.1]
toolkits_tests: yes [using nose version 1.3.0 / using mock 1.0.1]
OPTIONAL BACKEND EXTENSIONS
macosx: no [Mac OS-X only]
qt5agg: no [PyQt5 not found]
qt4agg: no [PySide not found; PyQt4 not found]
gtk3agg: no [Requires pygobject to be installed.]
gtk3cairo: no [Requires cairocffi or pycairo to be installed.]
gtkagg: no [Requires pygtk]
tkagg: no [The C/C++ header for Tk (tk.h) could not be
found. You may need to install the development
package.]
wxagg: no [requires wxPython]
gtk: no [Requires pygtk]
agg: yes [installing]
cairo: no [cairocffi or pycairo not found]
windowing: no [Microsoft Windows only]
OPTIONAL LATEX DEPENDENCIES
dvipng: no
ghostscript: yes [version 8.71]
latex: yes [version 3.1415926]
pdftops: no
============================================================================
* The following required packages can not be built:
* freetype, png
(virtualenv)vikaskuk#beehive:~/matplotlib/matplotlib-master$ python setup.py install
============================================================================
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
matplotlib: yes [1.5.dev1]
python: yes [2.6.6 (r266:84292, Sep 15 2010, 16:22:56) [GCC
4.4.5]]
platform: yes [linux2]
REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [not found. pip may install it below.]
six: yes [using six version 1.5.2]
dateutil: yes [using dateutil version 2.1]
pytz: yes [pytz was not found. pip will attempt to install
it after matplotlib.]
tornado: yes [tornado was not found. It is required for the
WebAgg backend. pip/easy_install may attempt to
install it after matplotlib.]
pyparsing: yes [pyparsing was not found. It is required for
mathtext support. pip/easy_install may attempt to
install it after matplotlib.]
libagg: yes [pkg-config information for 'libagg' could not
be found. Using local copy.]
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.]
qhull: yes [pkg-config information for 'qhull' could not be
found. Using local copy.]
OPTIONAL SUBPACKAGES
sample_data: yes [installing]
toolkits: yes [installing]
tests: yes [using nose version 1.3.0 / using mock 1.0.1]
toolkits_tests: yes [using nose version 1.3.0 / using mock 1.0.1]
OPTIONAL BACKEND EXTENSIONS
macosx: no [Mac OS-X only]
qt5agg: no [PyQt5 not found]
qt4agg: no [PySide not found; PyQt4 not found]
gtk3agg: no [Requires pygobject to be installed.]
gtk3cairo: no [Requires cairocffi or pycairo to be installed.]
gtkagg: no [Requires pygtk]
tkagg: no [The C/C++ header for Tk (tk.h) could not be
found. You may need to install the development
package.]
wxagg: no [requires wxPython]
gtk: no [Requires pygtk]
agg: yes [installing]
cairo: no [cairocffi or pycairo not found]
windowing: no [Microsoft Windows only]
OPTIONAL LATEX DEPENDENCIES
dvipng: no
ghostscript: yes [version 8.71]
latex: yes [version 3.1415926]
pdftops: no
============================================================================
* The following required packages can not be built:
* freetype, png
But when I try to plot the graph I hit the original issue:
vikas#server:~/matplotlib/matplotlib-master$ cd ../../memory_profiler-0.36
vikas#server:~/memory_profiler-0.36$ ./mprof plot --output=plot.png
matplotlib is needed for plotting.
I was able to successfully do apt-get update(there was some firewall issue and then I successfully did: sudo apt-get install -y python-matplotlib.
But still I am getting some issue while running mprof:
vikas#server:~/memory_profiler-0.36$ ./mprof plot --output=plot.png
Using last profile data.
Traceback (most recent call last):
File "./mprof", line 494, in <module>
actions[get_action()]()
File "./mprof", line 454, in plot_action
pl.figure(figsize=(14, 6), dpi=90)
File "/usr/lib/pymodules/python2.7/matplotlib/pyplot.py", line 423, in figure
**kwargs)
File "/usr/lib/pymodules/python2.7/matplotlib/backends/backend_tkagg.py", line 79, in new_figure_manager
return new_figure_manager_given_figure(num, figure)
File "/usr/lib/pymodules/python2.7/matplotlib/backends/backend_tkagg.py", line 87, in new_figure_manager_given_figure
window = Tk.Tk()
File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1767, in __init__
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable
Why do I need to set the display? I am working on ubuntu hosted machine.
You need to install matplotlib, as instructed (this error in thrown by mprof when it can't find matplotlib).
You can do so using pip pip install matplotlib (you might need to prefix this with sudo) or your package manager:
sudo apt-get install -y python-matplotlib on Debian, Ubuntu and derivatives.
sudo yum install -y python-matplotlib on RHEL, CentOS and derivatives.
It seems matplotlib: 3.0.1 does not go well with python 3.7 in conda environment.
df.plot() command could not be executed properly showing "ImportError: matplotlib is required for plotting" but actually matplotlib is installed.
I tried to downgrade matplotlib to 3.0.0 then everything is fine.
conda install -n [your_conda_envionment] matplotlib==3.0.0
I had same problem on freshely installed Ubuntu 16.04. To solve it, I have installed SciPy like this:
sudo pip install scipy
Also I had to install tkinter lib like this:
sudo apt-get install python-tk
I guess somewhere in the past, matplotlib had scipy as dependency, but now it only has numpy, while mprof plot requires scipy.
I had the same problem. I used memory_profiler lib typing this commands
(mprof run runner.py and mprof plot) and got a message "matplotlib is needed for plotting"
I tried to get rid of this problem following advice I found here but in the result I solved this problem completing these simple steps:
delete files in /usr/lib64/python2.7/site-packages/ connected with matplotlib (or you can uninstall matplotlib using the ordinary way)
use sudo yum-builddep python-matplotlib to install connected packages (222 packages were installed, if you need apt-get, you need this command: sudo apt-get build-dep python-matplotlib)
install matplotlib sudo yum reinstall python-matplotlib (or use install command, with apt-get: sudo apt-get install python-matplotlib)
I believe this will help.
I tried to install matplotlib by following this video.
https://www.youtube.com/watch?v=-llHYUMH9Dg
I followed everything EXACTLY. It was working until I tried
C:\Python34\Scripts>pip install matplotlib
I then received this error message
Command "python setup.py egg_info" failed with error code 1 in C:\Users\KIEFER~1\AppData\Local\Temp\pip-build-kai2npum\matplotlib
I have no idea what to do. I just finished Codeacademy and I am wanting to move onto learning matplotlib.
I am very grateful for any help anyone can give, even if someone can point me in the right direction. I'm not asking to be spoon fed.
This is the full error message.
C:\Python34\Scripts>cmd
Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.
C:\Python34\Scripts>pip install matplotlib
Collecting matplotlib
Using cached matplotlib-1.5.2.tar.gz
Complete output from command python setup.py egg_info:
============================================================================
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
matplotlib: yes [1.5.2]
python: yes [3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015,
19:28:18) [MSC v.1600 32 bit (Intel)]]
platform: yes [win32]
REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.11.1]
dateutil: yes [dateutil was not found. It is required for date
axis support. pip/easy_install may attempt to
install it after matplotlib.]
pytz: yes [pytz was not found. pip will attempt to install
it after matplotlib.]
cycler: yes [cycler was not found. pip will attempt to
install it after matplotlib.]
tornado: yes [tornado was not found. It is required for the
WebAgg backend. pip/easy_install may attempt to
install it after matplotlib.]
pyparsing: yes [pyparsing was not found. It is required for
mathtext support. pip/easy_install may attempt to
install it after matplotlib.]
libagg: yes [pkg-config information for 'libagg' could not
be found. Using local copy.]
freetype: no [The C/C++ header for freetype (ft2build.h)
could not be found. You may need to install the
development package.]
png: no [The C/C++ header for png (png.h) could not be
found. You may need to install the development
package.]
qhull: yes [pkg-config information for 'qhull' could not be
found. Using local copy.]
OPTIONAL SUBPACKAGES
sample_data: yes [installing]
toolkits: yes [installing]
tests: yes [nose 0.11.1 or later is required to run the
matplotlib test suite. Please install it with pip or
your preferred tool to run the test suite / using
unittest.mock]
toolkits_tests: yes [nose 0.11.1 or later is required to run the
matplotlib test suite. Please install it with pip or
your preferred tool to run the test suite / using
unittest.mock]
OPTIONAL BACKEND EXTENSIONS
macosx: no [Mac OS-X only]
qt5agg: no [PyQt5 not found]
qt4agg: no [PySide not found; PyQt4 not found]
gtk3agg: no [Requires pygobject to be installed.]
gtk3cairo: no [Requires cairocffi or pycairo to be installed.]
gtkagg: no [Requires pygtk]
tkagg: yes [installing; run-time loading from Python Tcl /
Tk]
wxagg: no [requires wxPython]
gtk: no [Requires pygtk]
agg: yes [installing]
cairo: no [cairocffi or pycairo not found]
windowing: yes [installing]
OPTIONAL LATEX DEPENDENCIES
dvipng: no
ghostscript: no
latex: no
pdftops: no
OPTIONAL PACKAGE DATA
dlls: no [skipping due to configuration]
============================================================================
* The following required packages can not be built:
* freetype, png
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\KIEFER~1\AppData\Local\Temp\pip-build-nhz_3wzz\matplotlib
You are using pip version 7.1.2, however version 8.1.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
C:\Python34\Scripts>
Using Python 2.7 on Windows 7. Here is the command I am using to install and error message. Wondering if anyone have met with similar issues before? Thanks.
C:\Python27\Scripts>pip install matplotlib
Collecting matplotlib
Downloading matplotlib-1.5.2.tar.gz (51.6MB)
100% |################################| 51.6MB 19kB/s
Complete output from command python setup.py egg_info:
============================================================================
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
matplotlib: yes [1.5.2]
python: yes [2.7.11 (v2.7.11:6d1b6a68f775, Dec 5 2015,
20:40:30) [MSC v.1500 64 bit (AMD64)]]
platform: yes [win32]
REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.11.1]
dateutil: yes [dateutil was not found. It is required for date
axis support. pip/easy_install may attempt to
install it after matplotlib.]
pytz: yes [pytz was not found. pip will attempt to install
it after matplotlib.]
cycler: yes [cycler was not found. pip will attempt to
install it after matplotlib.]
tornado: yes [tornado was not found. It is required for the
WebAgg backend. pip/easy_install may attempt to
install it after matplotlib.]
pyparsing: yes [pyparsing was not found. It is required for
mathtext support. pip/easy_install may attempt to
install it after matplotlib.]
libagg: yes [pkg-config information for 'libagg' could not
be found. Using local copy.]
freetype: no [The C/C++ header for freetype (ft2build.h)
could not be found. You may need to install the
development package.]
png: no [The C/C++ header for png (png.h) could not be
found. You may need to install the development
package.]
qhull: yes [pkg-config information for 'qhull' could not be
found. Using local copy.]
OPTIONAL SUBPACKAGES
sample_data: yes [installing]
toolkits: yes [installing]
tests: yes [nose 0.11.1 or later is required to run the
matplotlib test suite. Please install it with pip or
your preferred tool to run the test suite / mock is
required to run the matplotlib test suite. Please
install it with pip or your preferred tool to run
the test suite]
toolkits_tests: yes [nose 0.11.1 or later is required to run the
matplotlib test suite. Please install it with pip or
your preferred tool to run the test suite / mock is
required to run the matplotlib test suite. Please
install it with pip or your preferred tool to run
the test suite]
OPTIONAL BACKEND EXTENSIONS
macosx: no [Mac OS-X only]
qt5agg: no [PyQt5 not found]
qt4agg: no [PySide not found; PyQt4 not found]
gtk3agg: no [Requires pygobject to be installed.]
gtk3cairo: no [Requires cairocffi or pycairo to be installed.]
gtkagg: no [Requires pygtk]
tkagg: yes [installing; run-time loading from Python Tcl /
Tk]
wxagg: no [requires wxPython]
gtk: no [Requires pygtk]
agg: yes [installing]
cairo: no [cairocffi or pycairo not found]
windowing: yes [installing]
OPTIONAL LATEX DEPENDENCIES
dvipng: no
ghostscript: no
latex: no
pdftops: no
OPTIONAL PACKAGE DATA
dlls: no [skipping due to configuration]
============================================================================
* The following required packages can not be built:
* freetype, png
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\foo\a
ppdata\local\temp\pip-build-zxfsow\matplotlib\
As you can see it png and freetype modules are missing. You need to install them separately.
Try doing the following :
> pip install freetype-py
> pip install pypng
> pip install matplotlib
I solved it by taking version 1.5.1
pip install matplotlib==1.5.1
it seems that version 1.5.2 installer is broken.
http://www.lfd.uci.edu/~gohlke/pythonlibs/
Get matplotlib from above location. Choose correct package based on python(2.x/3.x) and bit(32/64) version.
32-bit 2.7: matplotlib-1.5.2-cp27-cp27m-win32.whl
64-bit 2.7: matplotlib-1.5.2-cp27-cp27m-win_amd64.whl
If you face any issues in the middle, please refer to below link:
https://stackoverflow.com/a/38618044/5334188
I had the exact same issue.
Seems that my pip was v7 which is old.
upgraded to v9 with the 'upgrade' button.
then tried to install matplotlib again and was successful this time.
maybe this helps
I came across the same problem with you, and here is my solution
It has the problem with python 3.6 integrated with the newest pip.
so I installed python 3.5.2 with pip, but do not upgrade pip.
And you can get matplotlib installed in this way.
Hope I could provide a possible solution
I solved the same problem in Wİndows 10 as folowing:
1- Download the following files for win32 or win64 python3.7:
matplotlib-2.2.2-cp27-cp37m-win32.whl
or
matplotlib-2.2.2-cp27-cp37m-win_amd64.whl
from the https://www.lfd.uci.edu/~gohlke/pythonlibs/
2- By cmd console run the downloaded file under python:
.\Downloads> python -m pip install matplotlib-2.2.2-cp37-cp37m-win_amd64.whl
you can try the matplolib
I had this problem today with Python 3.8.0 and the installation was successfully with matplotlib==3.2.0rc1 after I installed freetype-py.
Installing the specific matplotlib version 2.2.5 worked for me on Windows 10.
The commmand to install a specific version via pip:
pip install matplotlib==2.2.5
A simple
sudo pip install matplotlib --upgrade
fails with the following log:
Downloading/unpacking matplotlib from https://pypi.python.org/packages/source/m/matplotlib/matplotlib-1.5.0.tar.gz#md5=7952a539418ed77432aa4727409f24cf
Running setup.py egg_info for package matplotlib
============================================================================
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
matplotlib: yes [1.5.0]
python: yes [2.7.3 |EPD 7.3-2 (64-bit)| (default, Apr 12
2012, 11:14:05) [GCC 4.0.1 (Apple Inc. build
5493)]]
platform: yes [darwin]
REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.10.1]
dateutil: yes [using dateutil version 2.4.2]
pytz: yes [using pytz version 2015.7]
cycler: yes [cycler was not found. pip will attempt to
install it after matplotlib.]
tornado: yes [using tornado version 2.2]
pyparsing: yes [Your pyparsing contains a bug that will be
monkey-patched by matplotlib. For best results,
upgrade to pyparsing 2.0.1 or later.]
libagg: yes [pkg-config information for 'libagg' could not
be found. Using local copy.]
freetype: no [The C/C++ header for freetype2 (ft2build.h)
could not be found. You may need to install the
development package.]
png: yes [version 1.6.18]
qhull: yes [pkg-config information for 'qhull' could not be
found. Using local copy.]
OPTIONAL SUBPACKAGES
sample_data: yes [installing]
toolkits: yes [installing]
tests: yes [using nose version 1.1.2 / mock is required to
run the matplotlib test suite. "setup.py test" will
automatically download it. Install mock to run
matplotlib.test()]
toolkits_tests: yes [using nose version 1.1.2 / mock is required to
run the matplotlib test suite. "setup.py test" will
automatically download it. Install mock to run
matplotlib.test()]
OPTIONAL BACKEND EXTENSIONS
macosx: yes [installing, darwin]
qt5agg: no [PyQt5 not found]
qt4agg: yes [installing, Qt: 4.7.3, PySide: 1.1.0; PyQt4 not
found]
gtk3agg: no [Requires pygobject to be installed.]
gtk3cairo: no [Requires cairocffi or pycairo to be installed.]
gtkagg: no [Requires pygtk]
tkagg: yes [installing, version 81008]
wxagg: no [requires wxPython]
gtk: no [Requires pygtk]
agg: yes [installing]
cairo: no [cairocffi or pycairo not found]
windowing: no [Microsoft Windows only]
OPTIONAL LATEX DEPENDENCIES
dvipng: no
ghostscript: yes [version 9.16]
latex: no
pdftops: no
OPTIONAL PACKAGE DATA
dlls: no [skipping due to configuration]
============================================================================
* The following required packages can not be built:
* freetype
Complete output from command python setup.py egg_info:
============================================================================
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
matplotlib: yes [1.5.0]
python: yes [2.7.3 |EPD 7.3-2 (64-bit)| (default, Apr 12
2012, 11:14:05) [GCC 4.0.1 (Apple Inc. build
5493)]]
platform: yes [darwin]
REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.10.1]
dateutil: yes [using dateutil version 2.4.2]
pytz: yes [using pytz version 2015.7]
cycler: yes [cycler was not found. pip will attempt to
install it after matplotlib.]
tornado: yes [using tornado version 2.2]
pyparsing: yes [Your pyparsing contains a bug that will be
monkey-patched by matplotlib. For best results,
upgrade to pyparsing 2.0.1 or later.]
libagg: yes [pkg-config information for 'libagg' could not
be found. Using local copy.]
freetype: no [The C/C++ header for freetype2 (ft2build.h)
could not be found. You may need to install the
development package.]
png: yes [version 1.6.18]
qhull: yes [pkg-config information for 'qhull' could not be
found. Using local copy.]
OPTIONAL SUBPACKAGES
sample_data: yes [installing]
toolkits: yes [installing]
tests: yes [using nose version 1.1.2 / mock is required to
run the matplotlib test suite. "setup.py test" will
automatically download it. Install mock to run
matplotlib.test()]
toolkits_tests: yes [using nose version 1.1.2 / mock is required to
run the matplotlib test suite. "setup.py test" will
automatically download it. Install mock to run
matplotlib.test()]
OPTIONAL BACKEND EXTENSIONS
macosx: yes [installing, darwin]
qt5agg: no [PyQt5 not found]
qt4agg: yes [installing, Qt: 4.7.3, PySide: 1.1.0; PyQt4 not
found]
gtk3agg: no [Requires pygobject to be installed.]
gtk3cairo: no [Requires cairocffi or pycairo to be installed.]
gtkagg: no [Requires pygtk]
tkagg: yes [installing, version 81008]
wxagg: no [requires wxPython]
gtk: no [Requires pygtk]
agg: yes [installing]
cairo: no [cairocffi or pycairo not found]
windowing: no [Microsoft Windows only]
OPTIONAL LATEX DEPENDENCIES
dvipng: no
ghostscript: yes [version 9.16]
latex: no
pdftops: no
OPTIONAL PACKAGE DATA
dlls: no [skipping due to configuration]
============================================================================
* The following required packages can not be built:
* freetype
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build/matplotlib
Storing complete log in /Users/vlad-arisolteanu/.pip/pip.log
Meanwhile,
brew install freetype
returns:
Warning: freetype-2.6_1 already installed
So it looks like freetype is installed on my system. So what is going on? It's disappointing that such a critical Python package as matplotlib isn't installing.
Any help would be appreciated.
Since you're using Enthought, the recommended way to get stuff like matplotlib installed is to install Canopy Express, which is a free add-on to the Enthought distribution that also gives you access to ~100 packages that can be easily installed into Enthought.
What you're attempting to do with brew and such do not work for Enthought out of the box and would require you to set correct environment variables and build settings, because the system at large is not knowledgeable about brew's existence.
Its possible you need to install pkg-config. Try:
brew install pkg-config
before you install matplotlib.
See here for more discussion on this. It sounds like matplotlib gets confused about the path to freetype, but pkg-config overrides this and sets the right path. There's also the matplotlib readme here which suggests you need pkg-config.
I'm using matplotlib, OSX 10.11, Python 3.6 and matplotlib 1.5.1
make virtualenv (in a path with no spaces in it)
I already had python 3 installed and I found that giving the symlink didn’t install it, so I followed the symlink to the python3.6 file and used that. With the virtualenv -p command.
I installed the xquartz thing that is not in osx by default apparently and matplotlib still wouldn’t install. That is, until I found out that the matplotlib install thing looks in /include/ft2buid.h not in /include/freetype2/ft2build.h, so I setup a symlink in library to the /freetype2/ft2build.h file and then ran pip install matplotlib and it worked
Python isn’t installed as a framework…
I tried making this file called framework python that reroutes to python or something but that didn’t work
In the end I found a note that said go to folder:
~/.matplotlib (literally paste that in the go to folder dialogue verbatim)
then make a plain text file called matplotlibrc (no file extension) that just has the text:
backend: TkAgg
and that is what I call voodoo, now the rain demo for matplotlib works
this specific question might only need that one symlink bit, I gave myself the extra complexity of the virtualenv yet I can't remember why.
I am running Fedora Linux/RHEL on Oracle VirtualBox on my Windows 7 machine and trying to install matplotlib-1.3.1 on VM.
I have numpy-1.6.1, scipy-0.13.0 as well as python-2.6.6.
Both Numpy and Scipy are built from source i.e. downloaded the tar.gz file, extracted and then ran build and install from the extracted folders. I have also checked the installed versions from python shell.
However, whenever I am trying to build matplotlib-1.3.1 from source, it is giving me the below screen.
Below is the screen when building matplotlib from source:
~]$ python setup.py build
============================================================================
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
matplotlib: yes [1.3.1]
python: yes [2.6.6 (r266:84292, Jul 10 2013, 22:48:45) [GCC
4.4.7 20120313 (Red Hat 4.4.7-3)]]
platform: yes [linux2]
REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.6.1]
dateutil: yes [using dateutil version 2.1]
tornado: yes [tornado was not found. It is required for the
WebAgg backend. pip/easy_install may attempt to
install it after matplotlib.]
pyparsing: yes [pyparsing was not found. It is required for
mathtext support. pip/easy_install may attempt to
install it after matplotlib.]
pycxx: yes [Couldn't import. Using local copy.]
libagg: yes [pkg-config information for 'libagg' could not
be found. Using local copy.]
freetype: no [pkg-config information for 'freetype2' could
not be found.]
png: yes [version 1.2.49]
OPTIONAL SUBPACKAGES
sample_data: yes [installing]
toolkits: yes [installing]
tests: yes [using nose version 1.3.0]
OPTIONAL BACKEND EXTENSIONS
macosx: no [Mac OS-X only]
qt4agg: no [PyQt4 not found]
gtk3agg: no [Requires pygobject to be installed.]
gtk3cairo: no [Requires pygobject to be installed.]
gtkagg: no [Requires pygtk]
tkagg: no [TKAgg requires Tkinter.]
wxagg: no [requires wxPython]
gtk: no [Requires pygtk]
agg: yes [installing]
cairo: yes [installing, version 1.8.6]
windowing: no [Microsoft Windows only]
OPTIONAL LATEX DEPENDENCIES
dvipng: no
ghostscript: yes [version 8.70]
latex: no
pdftops: no
============================================================================
* The following required packages can not be built:
* freetype
I tried building dependencies for matplotlib as mentioned in Matplotlib install page but I get message "No source rpm found" as shown below:
~]$ su -c "yum-builddep python-matplotlib"
Password:
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
* HDP-epel: mirror.us.leaseweb.net
* base: mirror.dattobackup.com
* epel: mirror.us.leaseweb.net
* extras: centos.aol.com
* updates: mirror.cogentco.com
59 packages excluded due to repository priority protections
Checking for new repos for mirrors
Enabling epel-source repository
epel-source/metalink | 14 kB 00:00
epel-source | 3.3 kB 00:00
http://mirror.umd.edu/fedora/epel/6/SRPMS/repodata/repomd.xml: [Errno -1] repomd.xm does not match metalink for epel-source
Trying other mirror.
epel-source | 3.5 kB 00:00
epel-source/primary_db | 1.6 MB 00:01
9 packages excluded due to repository priority protections
No source RPM found for python-matplotlib-0.99.1.2-1.el6.x86_64
No uninstalled build requires
Just to note that I have successfully built from source nose-1.3.0, ipython-1.1.0, sympy-0.7.3, pandas-0.11.0 as dependencies before installing matplotlib.
The above problem is solved. It's because the required freetype package could not be found.
Interested readers may go to the link
Freetype-2.5.0 Install
and follow the steps to get freetype installed. Please note that after extracting the bz2 file, have to go into the folder to run the ./configure and make. For installing the doc, need to login as root user and follow the command as mentioned. Hope this helps.
NOTE: The above error that I have been getting is resolved but there is a new error that of ftheader.h not found is raised. I have opened a separate thread for that. Here is the link
Install error: ftheader.h: No such file or directory