Linux系统安装matplotlib,centos 7 下安装Matplotlib

本文讲述了如何在Python 3.4环境中通过`pip install`升级pip和安装matplotlib,过程中遇到的subprocess32编译错误被解决,以及后续对pypng和freetype-py的安装过程。
摘要由CSDN通过智能技术生成

[root@localhost bin]#

[root@localhost bin]#

[root@localhost bin]#

[root@localhost bin]# pip install matplotlib

Collecting matplotlib

Using cached matplotlib-2.0.2-cp27-cp27mu-manylinux1_x86_64.whl

Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=1.5.6 in /usr/lib/python2.7/site-packages (from matplotlib)

Requirement already satisfied: six>=1.10 in /usr/lib/python2.7/site-packages (from matplotlib)

Requirement already satisfied: pytz in /usr/lib/python2.7/site-packages (from matplotlib)

Requirement already satisfied: functools32 in /usr/lib/python2.7/site-packages (from matplotlib)

Requirement already satisfied: python-dateutil in /usr/lib/python2.7/site-packages (from matplotlib)

Requirement already satisfied: numpy>=1.7.1 in /usr/lib64/python2.7/site-packages (from matplotlib)

Requirement already satisfied: cycler>=0.10 in /usr/lib/python2.7/site-packages (from matplotlib)

Collecting subprocess32 (from matplotlib)

Using cached subprocess32-3.2.7.tar.gz

Installing collected packages: subprocess32, matplotlib

Running setup.py install for subprocess32 ... error

Complete output from command /usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-lXGAiP/subprocess32/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-kqqBsj-record/install-record.txt --single-version-externally-managed --compile:

running install

running build

running build_py

creating build

creating build/lib.linux-x86_64-2.7

copying subprocess32.py -> build/lib.linux-x86_64-2.7

running build_ext

building '_posixsubprocess' extension

creating build/temp.linux-x86_64-2.7

gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -c _posixsubprocess.c -o build/temp.linux-x86_64-2.7/_posixsubprocess.o

_posixsubprocess.c:3:20: fatal error: Python.h: No such file or directory

#include "Python.h"

^

compilation terminated.

error: command 'gcc' failed with exit status 1

----------------------------------------

Command "/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-lXGAiP/subprocess32/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-kqqBsj-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-lXGAiP/subprocess32/

[root@localhost bin]#

[root@localhost bin]#

[root@localhost bin]# pip3 install matplotlib

bash: pip3: command not found...

Similar command is: 'pip'

[root@localhost bin]#

[root@localhost bin]#

[root@localhost bin]# yum install python3-pip

Loaded plugins: fastestmirror, langpacks

^[[ALoading mirror speeds from cached hostfile

* base: centos.communilink.net

* epel: repo.ugm.ac.id

* extras: mirrors.btte.net

* updates: centos.communilink.net

No package python3-pip available.

Error: Nothing to do

[root@localhost bin]# yum install pip3

Loaded plugins: fastestmirror, langpacks

Loading mirror speeds from cached hostfile

* base: centos.communilink.net

* epel: mirror.rise.ph

* extras: mirrors.btte.net

* updates: centos.communilink.net

No package pip3 available.

Error: Nothing to do

[root@localhost bin]# pip install pip3

Collecting pip3

Could not find a version that satisfies the requirement pip3 (from versions: )

No matching distribution found for pip3

[root@localhost bin]#

[root@localhost bin]#

[root@localhost bin]#

[root@localhost bin]#

[root@localhost bin]#

[root@localhost bin]# yum search pip

Loaded plugins: fastestmirror, langpacks

Loading mirror speeds from cached hostfile

* base: centos.communilink.net

* epel: ftp.jaist.ac.jp

* extras: mirrors.btte.net

* updates: centos.communilink.net

====================================================== N/S matched: pip ======================================================

globus-xio-pipe-driver.x86_64 : Globus Toolkit - Globus Pipe Driver

globus-xio-pipe-driver-devel.x86_64 : Globus Toolkit - Globus Pipe Driver Development Files

libpipeline.i686 : A pipeline manipulation library

libpipeline.x86_64 : A pipeline manipulation library

libpipeline-devel.i686 : Header files and libraries for pipeline manipulation library

libpipeline-devel.x86_64 : Header files and libraries for pipeline manipulation library

nodejs-unpipe.noarch : Unpipe a stream from all destinations

pdns-backend-pipe.x86_64 : Pipe backend for pdns

perl-IO-Pipely.noarch : Portably create pipe() or pipe-like handles, one way or another

pipelight-selinux.noarch : SELinux-policy-module for pipelight

rubygem-apipie-bindings.noarch : The Ruby bindings for Apipie documented APIs

rubygem-apipie-bindings-doc.noarch : Documentation for rubygem-apipie-bindings

uwsgi-logger-pipe.x86_64 : uWSGI - logpipe logger plugin

vanessa_socket-pipe.x86_64 : Trivial TCP/IP pipe build using libvanessa_adt

aespipe.x86_64 : AES-based encryption tool for tar/cpio and loop-aes p_w_picpaths

globus-xio-popen-driver.x86_64 : Globus Toolkit - Globus XIO Pipe Open Driver

globus-xio-popen-driver-devel.x86_64 : Globus Toolkit - Globus XIO Pipe Open Driver Development Files

nodejs-archy.noarch : Renders nested hierarchies with unicode pipes

nodejs-event-stream.noarch : Construct pipes of streams of events

nodejs-map-stream.noarch : Construct pipes of streams of events

nodejs-stream-combiner.noarch : Turn a pipeline into a single stream

nodejs-streamsink.noarch : Pipe to a buffer, then create readable streams from it

php-react-stream.noarch : Basic readable and writable stream interfaces that support piping

pv.x86_64 : A tool for monitoring the progress of data through a pipeline

python-apipkg.noarch : A Python namespace control and lazy-import mechanism

python-django-pipeline.noarch : An asset packaging library for Django

python-virtualenv-api.noarch : An API for virtualenv/pip

python2-pip.noarch : A tool for installing and managing Python 2 packages

python34-pip.noarch : A tool for installing and managing Python3 packages

vodovod.x86_64 : A pipe connecting game

Name and summary matches only, use "search all" for everything.

[root@localhost bin]# yum install python34-pip

Loaded plugins: fastestmirror, langpacks

Loading mirror speeds from cached hostfile

* base: centos.communilink.net

* epel: epel.scopesky.iq

* extras: mirrors.btte.net

* updates: centos.communilink.net

Resolving Dependencies

--> Running transaction check

---> Package python34-pip.noarch 0:8.1.2-5.el7 will be installed

--> Processing Dependency: python(abi) = 3.4 for package: python34-pip-8.1.2-5.el7.noarch

--> Processing Dependency: python34-setuptools for package: python34-pip-8.1.2-5.el7.noarch

--> Processing Dependency: /usr/bin/python3.4 for package: python34-pip-8.1.2-5.el7.noarch

--> Running transaction check

---> Package python34.x86_64 0:3.4.5-3.el7 will be installed

--> Processing Dependency: python34-libs(x86-64) = 3.4.5-3.el7 for package: python34-3.4.5-3.el7.x86_64

--> Processing Dependency: libpython3.4m.so.1.0()(64bit) for package: python34-3.4.5-3.el7.x86_64

---> Package python34-setuptools.noarch 0:19.2-3.el7 will be installed

--> Running transaction check

---> Package python34-libs.x86_64 0:3.4.5-3.el7 will be installed

--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================================================================

Package                               Arch                     Version                          Repository              Size

==============================================================================================================================

Installing:

python34-pip                          noarch                   8.1.2-5.el7                      epel                   1.7 M

Installing for dependencies:

python34                              x86_64                   3.4.5-3.el7                      epel                    50 k

python34-libs                         x86_64                   3.4.5-3.el7                      epel                   6.7 M

python34-setuptools                   noarch                   19.2-3.el7                       epel                   373 k

Transaction Summary

==============================================================================================================================

Install  1 Package (+3 Dependent packages)

Total download size: 8.8 M

Installed size: 35 M

Is this ok [y/d/N]: y

Downloading packages:

(1/4): python34-3.4.5-3.el7.x86_64.rpm                                                                 |  50 kB  00:00:04

(2/4): python34-libs-3.4.5-3.el7.x86_64.rpm                                                            | 6.7 MB  00:01:03

(3/4): python34-setuptools-19.2-3.el7.noarch.rpm                                                       | 373 kB  00:00:05

(4/4): python34-pip-8.1.2-5.el7.noarch.rpm                                                             | 1.7 MB  00:00:11

------------------------------------------------------------------------------------------------------------------------------

Total                                                                                         114 kB/s | 8.8 MB  00:01:19

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

Installing : python34-3.4.5-3.el7.x86_64                                                                                1/4

Installing : python34-libs-3.4.5-3.el7.x86_64                                                                           2/4

Installing : python34-setuptools-19.2-3.el7.noarch                                                                      3/4

Installing : python34-pip-8.1.2-5.el7.noarch                                                                            4/4

Verifying  : python34-setuptools-19.2-3.el7.noarch                                                                      1/4

Verifying  : python34-pip-8.1.2-5.el7.noarch                                                                            2/4

Verifying  : python34-libs-3.4.5-3.el7.x86_64                                                                           3/4

Verifying  : python34-3.4.5-3.el7.x86_64                                                                                4/4

Installed:

python34-pip.noarch 0:8.1.2-5.el7

Dependency Installed:

python34.x86_64 0:3.4.5-3.el7       python34-libs.x86_64 0:3.4.5-3.el7       python34-setuptools.noarch 0:19.2-3.el7

Complete!

[root@localhost bin]# yum install python34-setuptools

Loaded plugins: fastestmirror, langpacks

Loading mirror speeds from cached hostfile

* base: centos.communilink.net

* epel: epel.scopesky.iq

* extras: mirrors.btte.net

* updates: centos.communilink.net

Package python34-setuptools-19.2-3.el7.noarch already installed and latest version

Nothing to do

[root@localhost bin]# easy_install-3.4 pip

Searching for pip

Best match: pip 8.1.2

Adding pip 8.1.2 to easy-install.pth file

Installing pip3.4 script to /usr/bin

Installing pip script to /usr/bin

Installing pip3 script to /usr/bin

Using /usr/lib/python3.4/site-packages

Processing dependencies for pip

Finished processing dependencies for pip

[root@localhost bin]# yum search easy_install

Loaded plugins: fastestmirror, langpacks

Loading mirror speeds from cached hostfile

* base: centos.communilink.net

* epel: kartolo.sby.datautama.net.id

* extras: mirrors.btte.net

* updates: centos.communilink.net

=================================================== Matched: easy_install ====================================================

python-XStatic-Angular.noarch : Angular 1.2.1 (XStatic packaging standard)

python-XStatic-Angular-Bootstrap.noarch : Angular-Bootstrap (XStatic packaging standard)

python-XStatic-Angular-Cookies.noarch : Angular-Cookies (XStatic packaging standard)

python-XStatic-Angular-Mock.noarch : Angular-Mock (XStatic packaging standard)

python-XStatic-Angular-lrdragndrop.noarch : Angular-lrdragndrop (XStatic packaging standard)

python-XStatic-Bootstrap-Datepicker.noarch : Bootstrap-Datepicker (XStatic packaging standard)

python-XStatic-Bootstrap-SCSS.noarch : Bootstrap-SCSS (XStatic packaging standard)

python-XStatic-D3.noarch : D3 (XStatic packaging standard)

python-XStatic-Font-Awesome.noarch : Font-Awesome (XStatic packaging standard)

python-XStatic-Hogan.noarch : Hogan (XStatic packaging standard)

python-XStatic-JQuery-Migrate.noarch : JQuery-Migrate (XStatic packaging standard)

python-XStatic-JQuery-TableSorter.noarch : JQuery-TableSorter (XStatic packaging standard)

python-XStatic-JQuery-quicksearch.noarch : JQuery-quicksearch (XStatic packaging standard)

python-XStatic-JSEncrypt.noarch : JSEncrypt (XStatic packaging standard)

python-XStatic-Jasmine.noarch : Jasmine (XStatic packaging standard)

python-XStatic-QUnit.noarch : QUnit (XStatic packaging standard)

python-XStatic-Rickshaw.noarch : Rickshaw (XStatic packaging standard)

python-XStatic-Spin.noarch : Spin (XStatic packaging standard)

python-XStatic-jQuery.noarch : jQuery 1.10.2 (XStatic packaging standard)

python-XStatic-jquery-ui.noarch : jquery-ui (XStatic packaging standard)

python-XStatic-smart-table.noarch : smart-table (XStatic packaging standard)

python-XStatic-termjs.noarch : term.js (XStatic packaging standard)

python2-XStatic-roboto-fontface.noarch : roboto-fontface (XStatic packaging standard)

python2-pip.noarch : A tool for installing and managing Python 2 packages

python34-pip.noarch : A tool for installing and managing Python3 packages

[root@localhost bin]# pip install freetype-py

Collecting freetype-py

Using cached freetype-py-1.0.2.tar.gz

Installing collected packages: freetype-py

Running setup.py install for freetype-py ... done

Successfully installed freetype-py-1.0.2

You are using pip version 8.1.2, however version 9.0.1 is available.

You should consider upgrading via the 'pip install --upgrade pip' command.

[root@localhost bin]# pip install --upgrade pip

Collecting pip

Using cached pip-9.0.1-py2.py3-none-any.whl

Installing collected packages: pip

Found existing installation: pip 8.1.2

Uninstalling pip-8.1.2:

Successfully uninstalled pip-8.1.2

Successfully installed pip-9.0.1

[root@localhost bin]#

[root@localhost bin]# pip isntall pypng

ERROR: unknown command "isntall" - maybe you meant "install"

[root@localhost bin]# pip install pypng

Collecting pypng

Using cached pypng-0.0.18.tar.gz

Installing collected packages: pypng

Running setup.py install for pypng ... done

Successfully installed pypng-0.0.18

[root@localhost bin]# pip install matplotlib

Collecting matplotlib

Downloading matplotlib-2.0.2-cp34-cp34m-manylinux1_x86_64.whl (14.6MB)

100% |████████████████████████████████| 14.6MB 63kB/s

Collecting numpy>=1.7.1 (from matplotlib)

Downloading numpy-1.12.1-cp34-cp34m-manylinux1_x86_64.whl (16.8MB)

100% |████████████████████████████████| 16.8MB 55kB/s

Collecting python-dateutil (from matplotlib)

Using cached python_dateutil-2.6.0-py2.py3-none-any.whl

Collecting pytz (from matplotlib)

Downloading pytz-2017.2-py2.py3-none-any.whl (484kB)

100% |████████████████████████████████| 491kB 359kB/s

Collecting cycler>=0.10 (from matplotlib)

Using cached cycler-0.10.0-py2.py3-none-any.whl

Collecting pyparsing!=2.0.0,!=2.0.4,!=2.1.2,!=2.1.6,>=1.5.6 (from matplotlib)

Downloading pyparsing-2.2.0-py2.py3-none-any.whl (56kB)

100% |████████████████████████████████| 61kB 475kB/s

Collecting six>=1.10 (from matplotlib)

Using cached six-1.10.0-py2.py3-none-any.whl

Installing collected packages: numpy, six, python-dateutil, pytz, cycler, pyparsing, matplotlib

Successfully installed cycler-0.10.0 matplotlib-2.0.2 numpy-1.12.1 pyparsing-2.2.0 python-dateutil-2.6.0 pytz-2017.2 six-1.10.0

[root@localhost bin]#

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值