2016-08-21 5 views
8

Verwenden von Python 2.7 auf Windows 7. Hier ist der Befehl, den ich zur Installation und Fehlermeldung verwende. Fragen Sie sich, ob jemand schon einmal ähnliche Probleme hatte? Vielen Dank.Python matplotlib Installationsproblem auf Windows 7 für FreeType, Png-Pakete

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\ 

Antwort

5

http://www.lfd.uci.edu/~gohlke/pythonlibs/

Get matplotlib von oben Lage. Wählen Sie das richtige Paket basierend auf Python (2.x/3.x) und 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 

Wenn Sie irgendwelche Fragen in der Mitte stellen, lesen Sie bitte folgenden Link: https://stackoverflow.com/a/38618044/5334188

+0

Danke, und inoffizielle libs funktioniert ziemlich gut als offizielle. :) –

+1

Markiere deine Antwort als Antwort, danke be_good_do_good. –

5

Wie Sie es png und freetype Module fehlen sehen können. Sie müssen sie separat installieren.

Versuchen Sie, die folgenden Aktionen ausführen:

> pip install freetype-py 
> pip install pypng 
> pip install matplotlib 
+1

Danke, Ryan, aber deine Methode hat immer noch Probleme. Ich habe das inoffizielle Paket von be_good_do_good ausprobiert und funktioniert ziemlich gut. :) –

+0

Obwohl ich frretype-py und pypng installieren kann, scheint matplotlib leider genau png und genau den freien Paketnamen – Antonio

+0

zu benötigen. Außerdem müssen die Pakete 'libpng-devel' und' libfreetype-devel' für das Installationsprogramm 'matplotlib' installiert werden um erfolgreich zu sein - es ist kein Problem mit dem Paketnamen (ich brauchte eine gute Stunde, um das herauszufinden). – zelanix

9

Ich löste es von Version unter 1.5.1

pip install matplotlib==1.5.1 

es, dass Version 1.5.2 scheint Installer kaputt ist.

+0

Dank Doron durch eine andere Option. :) –

2

stieß ich auf das gleiche Problem mit Ihnen, und hier ist meine Lösung

Es hat das Problem mit Python mit dem neuesten pip integriert 3.6. also habe ich python 3.5.2 mit pip installiert, aber pip nicht aktualisieren. Und Sie können Matplotlib auf diese Weise installiert bekommen.

Hoffnung konnte ich bieten eine mögliche Lösung

+0

Danke Mark, meine Situation ist, ich benutze Python 2.7. –

4

ich genau das gleiche Problem hatte.

Scheint, dass mein Pip v7 war, das alt ist. Upgrade auf Version 9 mit der Schaltfläche "Upgrade". dann versucht, Matplotlib wieder zu installieren und war dieses Mal erfolgreich.

vielleicht hilft dies

+0

Das war auch mein Problem, rettete mein Leben. Vielen Dank! – coolDude