Falha ao instalar biblioteca de python

Iniciado por Dapb, 14 de Dezembro de 2010, 19:24

tópico anterior - próximo tópico

Dapb

Estou tentando instalar a versão mais atualizada do matplotlib (preciso da versão mais atual), estou seguindo as instruções do site (http://matplotlib.sourceforge.net/users/installing.html#installing-from-source) onde baixei o source mas esta acontecendo o seguinte erro:

BUILDING MATPLOTLIB
            matplotlib: 1.0.0
                python: 2.6.6 (r266:84292, Sep 15 2010, 16:22:56)  [GCC
                        4.4.5]
              platform: linux2

REQUIRED DEPENDENCIES
                 numpy: 1.3.0
             freetype2: found, but unknown version (no pkg-config)
                        * WARNING: Could not find 'freetype2' headers in any
                        * of '/usr/local/include', '/usr/include', '.',
                        * '/usr/local/include/freetype2',
                        * '/usr/include/freetype2', './freetype2'.

OPTIONAL BACKEND DEPENDENCIES
                libpng: found, but unknown version (no pkg-config)
                        * Could not find 'libpng' headers in any of
                        * '/usr/local/include', '/usr/include', '.'
               Tkinter: no
                        * Using default library and include directories for
                        * Tcl and Tk because a Tk window failed to open.
                        * You may need to define DISPLAY for Tk to work so
                        * that setup can determine where your libraries are
                        * located. Tkinter present, but header files are not
                        * found. You may need to install development
                        * packages.
              wxPython: no
                        * wxPython not found
            pkg-config: looking for pygtk-2.0 gtk+-2.0
                        * Package pygtk-2.0 was not found in the pkg-config
                        * search path. Perhaps you should add the directory
                        * containing `pygtk-2.0.pc' to the PKG_CONFIG_PATH
                        * environment variable No package 'pygtk-2.0' found
                        * Package gtk+-2.0 was not found in the pkg-config
                        * search path. Perhaps you should add the directory
                        * containing `gtk+-2.0.pc' to the PKG_CONFIG_PATH
                        * environment variable No package 'gtk+-2.0' found
                        * You may need to install 'dev' package(s) to
                        * provide header files.
                  Gtk+: no
                        * Could not find Gtk+ headers in any of
                        * '/usr/local/include', '/usr/include', '.'
       Mac OS X native: no
                    Qt: no
                   Qt4: no
                 Cairo: 1.8.8

OPTIONAL DATE/TIMEZONE DEPENDENCIES
              datetime: present, version unknown
              dateutil: 1.4.1
                  pytz: 2010b

OPTIONAL USETEX DEPENDENCIES
                dvipng: no
           ghostscript: 8.71
                 latex: no
               pdftops: 0.14.3

[Edit setup.cfg to suppress the above messages]
============================================================================
pymods ['pylab']
packages ['matplotlib', 'matplotlib.backends', 'matplotlib.backends.qt4_editor', 'matplotlib.projections', 'matplotlib.testing', 'matplotlib.testing.jpl_units', 'matplotlib.tests', 'mpl_toolkits', 'mpl_toolkits.mplot3d', 'mpl_toolkits.axes_grid', 'mpl_toolkits.axes_grid1', 'mpl_toolkits.axisartist', 'matplotlib.sphinxext', 'matplotlib.numerix', 'matplotlib.numerix.mlab', 'matplotlib.numerix.ma', 'matplotlib.numerix.linear_algebra', 'matplotlib.numerix.random_array', 'matplotlib.numerix.fft', 'matplotlib.tri', 'matplotlib.delaunay']
running build
running build_py
copying lib/matplotlib/mpl-data/matplotlibrc -> build/lib.linux-x86_64-2.6/matplotlib/mpl-data
copying lib/matplotlib/mpl-data/matplotlib.conf -> build/lib.linux-x86_64-2.6/matplotlib/mpl-data
running build_ext
building 'matplotlib.ft2font' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/lib/python2.6/dist-packages/numpy/core/include -I/usr/local/include -I/usr/include -I. -I/usr/lib/python2.6/dist-packages/numpy/core/include/freetype2 -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I./freetype2 -I/usr/include/python2.6 -c src/ft2font.cpp -o build/temp.linux-x86_64-2.6/src/ft2font.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
In file included from src/ft2font.cpp:1:
src/ft2font.h:14: fatal error: ft2build.h: Arquivo ou diretório não encontrado
compilation terminated.
error: command 'gcc' failed with exit status 1


Alguém pode me ajudar a solucioná-lo?

Obrigado.

irtigor


Dapb

Citação de: irtigor online 14 de Dezembro de 2010, 19:39
Não acha melhor usar easy_install?

Irtigor, acabei de tentar o que propôs, porém não funcionou. O erro persiste: "error: Setup script exited with error: command 'gcc' failed with exit status 1"

irtigor

Estranho, porque ele deveria instalar as dependências que faltam, seguiu o faq? Mas se for o mesmo problema (sempre coloque a mensagem de erro inteira), instale as com final dev (fornecem os headers).

Dapb

Esse é o erro que continua dando:

BUILDING MATPLOTLIB
            matplotlib: 1.0.0
                python: 2.6.6 (r266:84292, Sep 15 2010, 16:22:56)  [GCC
                        4.4.5]
              platform: linux2

REQUIRED DEPENDENCIES
                 numpy: 1.3.0
             freetype2: found, but unknown version (no pkg-config)
                        * WARNING: Could not find 'freetype2' headers in any
                        * of '/usr/local/include', '/usr/include', '.',
                        * '/usr/local/include/freetype2',
                        * '/usr/include/freetype2', './freetype2'.

OPTIONAL BACKEND DEPENDENCIES
                libpng: found, but unknown version (no pkg-config)
                        * Could not find 'libpng' headers in any of
                        * '/usr/local/include', '/usr/include', '.'
               Tkinter: no
                        * Using default library and include directories for
                        * Tcl and Tk because a Tk window failed to open.
                        * You may need to define DISPLAY for Tk to work so
                        * that setup can determine where your libraries are
                        * located. Tkinter present, but header files are not
                        * found. You may need to install development
                        * packages.
              wxPython: no
                        * wxPython not found
            pkg-config: looking for pygtk-2.0 gtk+-2.0
                        * Package pygtk-2.0 was not found in the pkg-config
                        * search path. Perhaps you should add the directory
                        * containing `pygtk-2.0.pc' to the PKG_CONFIG_PATH
                        * environment variable No package 'pygtk-2.0' found
                        * Package gtk+-2.0 was not found in the pkg-config
                        * search path. Perhaps you should add the directory
                        * containing `gtk+-2.0.pc' to the PKG_CONFIG_PATH
                        * environment variable No package 'gtk+-2.0' found
                        * You may need to install 'dev' package(s) to
                        * provide header files.
                  Gtk+: no
                        * Could not find Gtk+ headers in any of
                        * '/usr/local/include', '/usr/include', '.'
       Mac OS X native: no
                    Qt: no
                   Qt4: no
                 Cairo: 1.8.8

OPTIONAL DATE/TIMEZONE DEPENDENCIES
              datetime: present, version unknown
              dateutil: 1.4.1
                  pytz: 2010b

OPTIONAL USETEX DEPENDENCIES
                dvipng: no
           ghostscript: 8.71
                 latex: no
               pdftops: 0.14.3

[Edit setup.cfg to suppress the above messages]
============================================================================
pymods ['pylab']
packages ['matplotlib', 'matplotlib.backends', 'matplotlib.backends.qt4_editor', 'matplotlib.projections', 'matplotlib.testing', 'matplotlib.testing.jpl_units', 'matplotlib.tests', 'mpl_toolkits', 'mpl_toolkits.mplot3d', 'mpl_toolkits.axes_grid', 'mpl_toolkits.axes_grid1', 'mpl_toolkits.axisartist', 'matplotlib.sphinxext', 'matplotlib.numerix', 'matplotlib.numerix.mlab', 'matplotlib.numerix.ma', 'matplotlib.numerix.linear_algebra', 'matplotlib.numerix.random_array', 'matplotlib.numerix.fft', 'matplotlib.tri', 'matplotlib.delaunay']
warning: no files found matching 'MANIFEST'
warning: no files found matching 'examples/data/*'
warning: no files found matching 'lib/mpl_toolkits'
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
In file included from src/ft2font.cpp:1:
src/ft2font.h:14: fatal error: ft2build.h: Arquivo ou diretório não encontrado
compilation terminated.
error: Setup script exited with error: command 'gcc' failed with exit status 1


O que é fac? Também não entendi quando disse "instale as com final dev (fornecem os headers)."
Me desculpe se essas dúvidas forem muito básicas, mas sou iniciante em linux.

irtigor

FAQ - Frequently Asked Questions, ou em português perguntas frequentes -> http://matplotlib.sourceforge.net/faq/installing_faq.html#easy-install

Na mensagem de erro, ele diz que encontrou o freetype2 mas não o seu header, ou seja, falta o pacote do freetype com dev no final: libfreetype6-dev. O mesmo acontece com a libpng, pygtk e gtk+ que estão listado como opcionais (instale a versão com "dev" se precisar).