153 votes

Ubuntu exécutant `pip install` donne l'erreur 'The following required packages can not be built : * freetype'

Lors de l'exécution pip install -r requirements.txt Je reçois l'erreur suivante pendant la phase d'installation. matplotlib :

REQUIRED DEPENDENCIES AND EXTENSIONS
                 numpy: yes [not found. pip may install it below.]
              dateutil: yes [dateutil was not found. It is required for date
                        axis support. pip/easy_install may 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.]
                 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.]

...

The following required packages can not be built:

                    * freetype

Il ne faut pas pip install -r requirements.txt installer aussi freetype ? Comment installer freetype dans Ubuntu 12.04 afin qu'il fonctionne avec matploglib ?

4voto

Caleb Kiage Points 479

Sur Ubuntu, cela a fonctionné après avoir installé blt-dev paquet.

$sudo apt-get install blt-dev
$pip install matplotlib

1voto

AndreL Points 2695

J'utilise Mint et aucune de ces réponses n'a fonctionné pour moi, j'en avais besoin :

sudo apt-get install build-essential g++

1voto

klimenkov Points 1

J'ai eu le même problème avec Python 3.6 sous Windows, mais je suis passé à Python 3.5.2 et tout fonctionne bien.

0voto

StackEdd Points 53

Cette commande sudo apt-get install libfreetype6-dev a échoué pour moi sur ubuntu 16.04,
The following packages have unmet dependencies: libfreetype6-dev : Depends: libfreetype6 (= 2.6.1-0.1ubuntu2) but 2.6.1-0.1ubuntu2.3 is to be installed

J'ai donc téléchargé et installé freetype à partir du site source le crédit à cette guide

$ tar -xvjf freetype-x.y.tar.bz2  # extract the downloaded version file
$ cd freetype-x.y/ 
$ ./configure
$ make
$ sudo make install 

est passé à virtualenv et pip install matplotlib et tout fonctionne.

Prograide.com

Prograide est une communauté de développeurs qui cherche à élargir la connaissance de la programmation au-delà de l'anglais.
Pour cela nous avons les plus grands doutes résolus en français et vous pouvez aussi poser vos propres questions ou résoudre celles des autres.

Powered by:

X