centos下安装pip, psutil容易踩的坑.

摘要: 安装PIP, 直接用yum install pip 估计多半不会成功。[root@wfm ~]# yum -y install pipLoaded plugins: fastestmirror, refresh-packagekit, securityLoading mirror speeds from cached hostfile* base: mirrors.tuna.tsinghua.edu.cn

安装PIP, 直接用yum install pip 估计多半不会成功。
[root@wfm ~]# yum -y install pip
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors.tuna.tsinghua.edu.cn
* extras: mirrors.tuna.tsinghua.edu.cn
* updates: mirrors.tuna.tsinghua.edu.cn
Setting up Install Process
No package pip available.
Error: Nothing to do

解决方法:  

需要先安装扩展源EPEL。

EPEL(http://fedoraproject.org/wiki/EPEL) 是由 Fedora 社区打造,为 RHEL 及衍生发行版如 CentOS、Scientific Linux 等提供高质量软件包的项目。

首先安装epel扩展源:

sudo yum -y install epel-release

然后再安装pip
~]# sudo yum -y install python-pip
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
epel/metalink | 4.9 kB 00:00 
* base: mirrors.tuna.tsinghua.edu.cn
* epel: mirrors.neusoft.edu.cn
* extras: mirrors.tuna.tsinghua.edu.cn
* updates: mirrors.tuna.tsinghua.edu.cn
epel | 4.3 kB 00:00 
epel/primary_db | 5.8 MB 00:07 
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package python-pip.noarch 0:7.1.0-1.el6 will be installed
--> Processing Dependency: python-setuptools for package: python-pip-7.1.0-1.el6.noarch
--> Running transaction check
---> Package python-setuptools.noarch 0:0.6.10-3.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================
Package Arch Version Repository
Size
================================================================
Installing:
python-pip noarch 7.1.0-1.el6 epel 1.5 M
Installing for dependencies:
python-setuptools noarch 0.6.10-3.el6 base 336 k

Transaction Summary
================================================================
Install 2 Package(s)

Total download size: 1.9 M
Installed size: 8.1 M
Downloading Packages:
(1/2): python-pip-7.1.0-1.el6.noarch.rpm | 1.5 MB 00:01 
(2/2): python-setuptools-0.6.10-3.el6.no | 336 kB 00:00 
----------------------------------------------------------------
Total 755 kB/s | 1.9 MB 00:02 
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Importing GPG key 0x0608B895:
Userid : EPEL (6) 
Package: epel-release-6-8.noarch (@extras)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : python-setuptools-0.6.10-3.el6.noarch 1/2 
Installing : python-pip-7.1.0-1.el6.noarch 2/2 
Verifying : python-pip-7.1.0-1.el6.noarch 1/2 
Verifying : python-setuptools-0.6.10-3.el6.noarch 2/2

Installed:
python-pip.noarch 0:7.1.0-1.el6

Dependency Installed:
python-setuptools.noarch 0:0.6.10-3.el6


安装好pip之后,用他来安装psutil的时候,估计又会出问题了。这个时候首先检查gcc是否安装,然后检查 python-devel是否安装,没有的话,执行
yum install python-devel


成功之后,然后执行
pip install psutil

上一篇: tornado热加载框架
下一篇: springboot2.x使用interceptor之后静态资源文件加载问题
 评论 ( What Do You Think )
名称
邮箱
网址
评论
验证
   
 

 


  • 微信公众号

  • 我的微信

站点声明:

1、一号门博客CMS,由Python, MySQL, Nginx, Wsgi 强力驱动

2、部分文章或者资源来源于互联网, 有时候很难判断是否侵权, 若有侵权, 请联系邮箱:summer@yihaomen.com, 同时欢迎大家注册用户,主动发布无版权争议的 文章/资源.

3、鄂ICP备14001754号-3, 鄂公网安备 42280202422812号