加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Python > 正文

如何为python 2.7安装pip?

发布时间:2020-12-20 11:09:16 所属栏目:Python 来源:网络整理
导读:我按照链接@ https://linuxize.com/post/how-to-install-pip-on-centos-7/#2-install-pip来安装pip,但是它为系统附带的python 2.6安装了,如何为python 2.7安装它? sudo yum install epel-releaseLoaded plugins: securitySetting up Install ProcessPackage
我按照链接@ https://linuxize.com/post/how-to-install-pip-on-centos-7/#2-install-pip来安装pip,但是它为系统附带的python 2.6安装了,如何为python 2.7安装它?

sudo yum install epel-release
Loaded plugins: security
Setting up Install Process
Package epel-release-6-8.noarch already installed and latest version
Nothing to do

安装点子

sudo yum install python-pip
Loaded plugins: security
Setting up Install Process
Package python-pip-7.1.0-1.el6.noarch already installed and latest version
Nothing to do

点子版

pip --version
pip 7.1.0 from /usr/lib/python2.6/site-packages (python 2.6)

机器配置:

LSB Version:    :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: OracleServer
Description:    Oracle Linux Server release 6.6
Release:    6.6
Codename:   n/a

在/ usr /本地

enter image description here

解决方法

尝试手动安装:

wget -P ~/.local/lib https://bootstrap.pypa.io/get-pip.py
python2.7 ~/.local/lib/get-pip.py --user 
#if using bash
printf "nPATH=$PATH:~/.local/bin/" >> ~/.bashrc
source ~/.bashrc

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读