centos下安装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

如果,出现问题可以卸载重装epel-release:

1.yum remove epel-release
2.清空epel目录:rm -rf /var/cache/yum/x86_64/6/epel/
3.安装,yum 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) <epel@fedoraproject.org>
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


Complete!

OK 成功!

如果安装报错:pip安装pkg_resources.DistributionNotFound: pip==9.0.1   #参考:https://blog.csdn.net/daiyutage/java/article/details/69945850

执行pip命令报错

Traceback (most recent call last):
File "./pip", line 5, in <module>
from pkg_resources import load_entry_point
File "/opt/soft/distribute-0.7.3/pkg_resources.py", line 2989, in <module>
working_set.require(__requires__)
File "/opt/soft/distribute-0.7.3/pkg_resources.py", line 726, in require
needed = self.resolve(parse_requirements(requirements))
File "/opt/soft/distribute-0.7.3/pkg_resources.py", line 624, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: pip==9.0.1

应该是缺少pip9.0.1
执行easy_install pip==9.0.1又报错

Traceback (most recent call last):
File "/usr/bin/easy_install", line 5, in <module>
from pkg_resources import load_entry_point
File "/opt/soft/distribute-0.7.3/pkg_resources.py", line 2993, in <module>
parse_requirements(__requires__), Environment()
File "/opt/soft/distribute-0.7.3/pkg_resources.py", line 624, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: distribute==0.6.10

再安装distribute包

wget http://pypi.python.org/packages/source/d/distribute/distribute-0.6.10.tar.gz
cd distribute-0.6.10
python setup.py install

再次安装pip9.0.1

easy_install pip==9.0.1

安装成功

Adding pip 9.0.1 to easy-install.pth file
Installing pip script to /usr/local/python2.7/bin
Installing pip2.7 script to /usr/local/python2.7/bin
Installing pip2 script to /usr/local/python2.7/bin

Installed /usr/local/python2.7/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg
Processing dependencies for pip==9.0.1
Finished processing dependencies for pip==9.0.1

运行pip

 

Linux—yum安装python-pip的更多相关文章

  1. 转: Red Hat/Fedora Linux 上使用 yum 安装 python pip 模块

    from: http://www.cnblogs.com/moinmoin/archive/2012/03/07/red-hat-Fedora-python-pip-install-how.html ...

  2. Linux下安装Python pip

    在Python环境下,pip提供类似yum一样的下载方式,比easy_install方便的多. 1.下载get-pip.py wget https://bootstrap.pypa.io/get-pi ...

  3. Linux 下安装python软件包(pip、nose、virtualenv、distribute )

    新手刚开始学习Python,目前学习<笨方法学python>ing- 在学习习题46时需要安装几个软件包:pip.nose.virtualenv.distribute !在此记录Linux ...

  4. 环境部署(九):linux下安装python+chrome+Xvfb

    在基于selenium进行的UI自动化测试中,开发调试环境一般都是windows操作系统.完成后需要部署到专门的测试环境. 如要要部署到linux环境的服务器(阿里云.腾讯云)执行,那么测试脚本也需要 ...

  5. python 基础1.1--windows/linux 下安装python

    一.windows下安装python 1>windows上python后缀是.msi的,下载下来后,直接双击运行.会在c盘生成python.exe的文件,把python.exe的文件加入到win ...

  6. linux下安装python

    在Linux下安装Python的操作相当简单,按如下步骤操作即可: 命令: wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgzt ...

  7. linux下安装python linux下一些常用的命令

    注意 ubuntukylin-14.04.2-desktop-amd64 自带python2.7.6 这个说的比较详细 http://wenku.baidu.com/link?url=gaeFcQrc ...

  8. Linux 下安装Python报错:zlib not available

    问题描述: 在Linux下安装Python时出现一个错误:zipimport.ZipImportError: can't decompress data; zlib not available 详细错 ...

  9. Python原来这么好学-1.2节: 在Linux中安装python

    这是一本教同学们彻底学通Python的高质量学习教程,认真地学习每一章节的内容,每天只需学好一节,帮助你成为一名卓越的Python程序员: 本教程面向的是零编程基础的同学,非科班人士,以及有一定编程水 ...

  10. linux下安装python和pip

    注意:不要轻易去卸载原有的python环境,因为有些软件是依赖他的 一:安装前,先将依赖环境一并安装,避免后面重复编译 [root@redhat2 bin]# yum install gcc g++ ...

随机推荐

  1. 树的子结构 牛客网 剑指Offer

    树的子结构 牛客网 剑指Offer 题目描述 输入两棵二叉树A,B,判断B是不是A的子结构.(ps:我们约定空树不是任意一个树的子结构) # class TreeNode: # def __init_ ...

  2. hdu 2159 FATE(DP)

    题意: 小余玩游戏,离最后一级还需n的经验值,但是他已经很厌烦了,还剩下m的忍耐度.每杀一只怪小余会得到相应的经验,同时减掉相应的忍耐度. 当忍耐度降到0或者0以下时,小余就不会再玩这个游戏.小余还说 ...

  3. js 在浏览器中的event loop事件队列

    目录 前言 认识一个栈两个队列 执行过程 异步任务怎么分配 简单例子 难一点的例子 前言 以下内容是js在浏览器中的事件队列执行,与在nodejs中有所区别,请注意. 都说js是单线程的,不过它本身其 ...

  4. Centos 7 局域网 yum 源搭建

    一.需求及实现方式介绍: 需求:现在各个软件版本更新迭代很快,在我们部署一套集群(比如:openstack)后,如果过一段时间想扩展集群时发现软件版本早已迭代更新,安装后导致和现有环境或多或少不兼容, ...

  5. vivo 全球商城:商品系统架构设计与实践

    一.前言 随着用户量级的快速增长,vivo官方商城v1.0的单体架构逐渐暴露出弊端:模块愈发臃肿.开发效率低下.性能出现瓶颈.系统维护困难. 从2017年开始启动的v2.0架构升级,基于业务模块进行垂 ...

  6. vue禁用浏览器回退

    解决方案 mounted() { history.pushState(null, null, document.URL) window.addEventListener('popstate', () ...

  7. 使用Abp vnext构建基于Duende.IdentityServer的统一授权中心(一)

    原来看到很多示例都是基于IdentityServer4的统一授权中心,但是IdentityServer4维护到2022年就不再进行更新维护了,所以我选择了它的升级版Duende.IdentitySer ...

  8. LeetCode刷题 树专题

    树专题 关于树的几个基本概念 1 树的节点定义 2 关于二叉树的遍历方法 2.1 前序遍历 2.2 中序遍历 2.3 后序遍历 2.4 层序遍历 3 几种常见的树介绍 3.1 完全二叉树 3.2 二叉 ...

  9. 湖湘杯2020 writeup

    这个平台中间卡的离谱,卡完过后交了flag分还掉了 Web 题目名字不重要 也算是非预期吧,赛后y1ng师傅也说了因为要多端口环境必须这样配,预期解很难 NewWebsite 后台弱口令admin a ...

  10. IDEA 运行maven工程报错:No goals have been specified for this build.....解决办法

    出现这种错误可以在pom.xml里配置, 找到<build>标签在下面<plugins>标签上面加上<defaultGoal>compile</default ...