2014-09-04 14 views
49

Wenn ich versuche, meine matplotlib mit pip zu aktualisieren, es gibt:ubuntu 14.04, pip nicht aktualisieren können matplotllib

Downloading/unpacking matplotlib from https://pypi.python.org/packages/source/m/matplotlib/matplotlib-1.4.0.tar.gz#md5=1daf7f2123d94745feac1a30b210940c 
    Downloading matplotlib-1.4.0.tar.gz (51.2MB): 51.2MB downloaded 
    Running setup.py (path:/tmp/pip_build_root/matplotlib/setup.py) egg_info for package matplotlib 
    ============================================================================ 
    Edit setup.cfg to change the build options 

    BUILDING MATPLOTLIB 
       matplotlib: yes [1.4.0] 
        python: yes [2.7.6 (default, Mar 22 2014, 22:59:38) [GCC 
          4.8.2]] 
        platform: yes [linux2] 

    REQUIRED DEPENDENCIES AND EXTENSIONS 
        numpy: yes [version 1.8.2] 
         six: yes [using six version 1.7.3] 
        dateutil: yes [using dateutil version 2.2] 
        tornado: yes [using tornado version 4.0.1] 
       pyparsing: yes [using pyparsing version 2.0.2] 
        pycxx: yes [Couldn't import. Using local copy.] 
        libagg: yes [pkg-config information for 'libagg' could not 
          be found. Using local copy.] 
    Traceback (most recent call last): 
     File "<string>", line 17, in <module> 
     File "/tmp/pip_build_root/matplotlib/setup.py", line 154, in <module> 
     result = package.check() 
     File "setupext.py", line 940, in check 
     if 'No such file or directory\ngrep:' in version: 
    TypeError: argument of type 'NoneType' is not iterable 
    Complete output from command python setup.py egg_info: 
    ============================================================================ 

Edit setup.cfg to change the build options 



BUILDING MATPLOTLIB 

      matplotlib: yes [1.4.0] 

       python: yes [2.7.6 (default, Mar 22 2014, 22:59:38) [GCC 

         4.8.2]] 

       platform: yes [linux2] 



REQUIRED DEPENDENCIES AND EXTENSIONS 

       numpy: yes [version 1.8.2] 

        six: yes [using six version 1.7.3] 

       dateutil: yes [using dateutil version 2.2] 

       tornado: yes [using tornado version 4.0.1] 

      pyparsing: yes [using pyparsing version 2.0.2] 

       pycxx: yes [Couldn't import. Using local copy.] 

       libagg: yes [pkg-config information for 'libagg' could not 

         be found. Using local copy.] 

Traceback (most recent call last): 

    File "<string>", line 17, in <module> 

    File "/tmp/pip_build_root/matplotlib/setup.py", line 154, in <module> 

    result = package.check() 

    File "setupext.py", line 940, in check 

    if 'No such file or directory\ngrep:' in version: 

TypeError: argument of type 'NoneType' is not iterable 

---------------------------------------- 
Cleaning up... 
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/matplotlib 
Storing debug log for failure in /home/username/.pip/pip.log 

Im Ende des Protokolls heißt es:

Exception information: 
Traceback (most recent call last): 
    File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/basecommand.py", line 122, in main 
    status = self.run(options, args) 
    File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/commands/install.py", line 278, in run 
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) 
    File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 1229, in prepare_files 
    req_to_install.run_egg_info() 
    File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 325, in run_egg_info 
    command_desc='python setup.py egg_info') 
    File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/util.py", line 697, in call_subprocess 
    % (command_desc, proc.returncode, cwd)) 
InstallationError: Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/matplotlib 

Warum es versäumte ? Vielen Dank!

+0

Es könnte, wenn Sie hilfreich sein sagen Sie uns, welches Betriebssystem Sie benutzen und welchen genauen Pip-Befehl Sie ausgegeben haben. – Adobe

+0

Ich sagte es im Titel. Ubuntu 14.04. Aber die Antwort unten half mir trotzdem. Ich danke dir sehr! :-) – astroboylrx

Antwort

71

Dies ist ein bekannter Fehler, der am Master behoben wurde (https://github.com/matplotlib/matplotlib/pull/3414).

Der Fehler ist bei der Suche nach einer freetype Installation. Wenn Sie das Linux-Paket freetype-dev installieren, vermeiden Sie diesen Fehler und können matplotlib kompilieren.

sudo apt-get install libfreetype6-dev 
+15

Bestätigen Sie die Installation von libfreetype6-dev als Workaround – Vanuan

+0

Wird 'freetype6-dev' (und vielleicht' libxft-dev' für Ubuntu 14 server) mit 'apt-get build-dep python-matplotlib' installiert? – drevicko

+1

Ich kann bestätigen, dass dies auch für Ubuntu 16.04 gilt und die angegebene Lösung funktioniert. – h7r

68

Am 14. Ubuntu Server, müssen Sie auch libxft-dev

sudo apt-get install libfreetype6-dev libxft-dev 
+2

Es scheint sehr schwierig zu sein, was zu tun ist. Wie auch immer, es sieht aus wie Ubuntu 14 sudo apt-get install libfreetype6-dev libxft-dev gefolgt von sudo pip install matplotlib WORKS !! – Somum

+0

Das hat für mich funktioniert. Ta! – PerceptualRobotics

+0

Dies ist auch für Bash unter Windows 10 erforderlich. – Ninjakannon

11

Ich hatte die gleichen Probleme versuchen matplotlib auf Python installieren 3 zu installieren pip3 verwenden, und es scheint, dass dieses Problem zusammenhängt auf eine nackte Knochen-Installation von Python 3 und einem zu tun:

sudo apt-get build-dep matplotlib 

von

gefolgt
sudo pip3 install matplotlib 

ist wahrscheinlich eine bessere Lösung als die selektive Installation nur der Bibliotheken, die sich auf matplotlib beziehen.

+1

Es funktioniert gut in Ubunu14.04! –

+0

In Ubuntu 15.04 möchte dies 419 Pakete mit insgesamt 1 GB installieren. – knite

+0

@knite Das ist ein Kompromiss zwischen manuellem Abhängigkeitsmanagement und Bequemlichkeit. – tchakravarty

3

Da mac nicht über apt-get Sie, auf OSX was Sie tun müssen:

brew install freetype 

dann können Sie laufen:

pip install matplotlib 
+1

Ich musste auch 'pkg-config' mit' brew install pkg-config' installieren und dann funktionierte es. – user3148185

1

diese Seite gefunden, während für fedora Antwort suchen 24.

RPM-Lösung ist:

dnf install freetype-devel

0

Ich habe versucht zu aktualisieren direkt mit Sudo Pip, aber Änderungen werden nicht zuletzt gespeichert. Also ich erste Update Cmd im Terminal verwenden:

sudo apt-get update 

dann verwendet, i sudo installieren:

sudo apt-get install libffi-dev 

schließlich seine installierte durch diese Methode zu tun.

+3

Während dieses Code-Snippet die Frage lösen kann, hilft [einschließlich einer Erklärung] (// meta.stackexchange.com/questions/114762/explaining-entirely-code-based-answers) wirklich, die Qualität Ihres Posts zu verbessern. Denken Sie daran, dass Sie die Frage für Leser in der Zukunft beantworten, und diese Leute könnten die Gründe für Ihren Codevorschlag nicht kennen. Bitte versuchen Sie auch nicht, Ihren Code mit erklärenden Kommentaren zu füllen, dies reduziert die Lesbarkeit sowohl des Codes als auch der Erklärungen! – kayess

+0

ok ich nehme es als notiz für die zukunft. – Rochan

+0

Hallo kayess ... Ich habe den Beitrag aktualisiert. Besser jetzt? – Rochan

1

Wenn Sie Ubuntu Server 14 erneut ausführen.04 u sollte hinzufügen, um dieses Schrift Abhängigkeit

sudo apt-get install libxft-dev 

Source

0

Für die auf Fedora 25 dieses Themas schlagen, musste ich diese beiden Pakete es funktioniert:

sudo dnf install freetype-devel gcc-c++