[python] `pip install`을 실행하는 Ubuntu는 ‘다음 필수 패키지를 빌드 할 수 없습니다 : * freetype’오류가 발생합니다

수행 할 때 pip install -r requirements.txt설치 단계에서 다음 오류가 발생합니다 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

pip install -r requirements.txt프리 타입도 설치 하지 않아야 합니까? Ubuntu 12.04에서 freetype을 어떻게 설치해야 작동 matplotlib합니까?



답변

아니요 pip. 시스템 수준의 종속성을 설치하지 않습니다. 이는 pipRPM ( Redhat 기반 시스템 ) 또는 DEB ( Debian 기반 시스템 )를 설치하지 않음을 의미 합니다.

시스템 종속성을 설치하려면 시스템에 따라 다음 방법 중 하나를 사용해야합니다.

우분투 / 데비안 :

apt-get install libfreetype6-dev

Ubuntu / Debian 기반 시스템에서 패키지를 검색하려면

apt-cache search <string>

예 :

apt-cache search freetype | grep dev

Redhat / CentOS / Fedora :

yum -y install freetype-devel

Redhat / CentOS / Fedora 기반 시스템에서 패키지를 검색하려면

yum search <string>

예 :

yum search freetype | grep devel

Mac OS X : ( Homebrew 를 통해 )

brew install freetype

Mac OS X 기반 시스템에서 패키지를 검색하려면

brew search <string>

예 :

brew search freetype


답변

우분투 서버 14.04에서 matplotlib를 활성화하려면 libxft-dev를 설치해야했습니다.

sudo apt-get install libfreetype6-dev libxft-dev

그런 다음 사용할 수 있습니다

sudo easy_install matplotlib


답변

해결 방법은 이 github 문제에서sudo apt-get install pkg-config 찾은 것 입니다 .


답변

기존 답변 중 Ubuntu에서 matplotlib을 업그레이드하는 데 도움이되지 않았습니다. 이것이 궁극적으로 저에게 효과적입니다.

$ sudo apt-get install build-dep python-matplotlib
$ pip install matplotlib --upgrade


답변

이 명령은 모든 종속성을 다운로드합니다.

파이썬 2.x

sudo apt-get install python-matplotlib

파이썬 3.x

sudo apt-get install python3-matplotlib

설치 후 시도해 볼 수 있습니다

(sudo) pip install matplotlib


답변

우분투에서는 blt-dev패키지를 설치 한 후에 작동했습니다 .

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


답변

나는 민트를 사용하고 있는데이 답변 중 어느 것도 나를 위해 일하지 않았다.

sudo apt-get install build-essential g++