linux环境安装python-pip

参考:https://blog.csdn.net/u013372487/article/details/51726002

1、通过wget方式安装

# wget https://bootstrap.pypa.io/get-pip.py --no-check-certificate
# python get-pip.py
# pip -V
pip 19.1.1 from /usr/lib/python2.7/site-packages/pip (python 2.7)
# pip install --upgrade pip

2、添加yum源安装rpm包

 1 添加epel源
 2 # vim epel.repo
 3 [epel]
 4 name=Extra Packages for Enterprise Linux 7 - $basearch
 5 baseurl=http://mirrors.aliyun.com/epel/7/$basearch
 6 #mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
 7 failovermethod=priority
 8 enabled=1
 9 gpgcheck=0
10 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
11  
12 [epel-debuginfo]
13 name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
14 baseurl=http://mirrors.aliyun.com/epel/7/$basearch/debug
15 #mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch
16 failovermethod=priority
17 enabled=0
18 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
19 gpgcheck=0
20  
21 [epel-source]
22 name=Extra Packages for Enterprise Linux 7 - $basearch - Source
23 baseurl=http://mirrors.aliyun.com/epel/7/SRPMS
24 #mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch
25 failovermethod=priority
26 enabled=0
27 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
28 gpgcheck=0
29 # yum -y install python-pip
30 # pip install --upgrade pip

 

上一篇:记录一次升级kernel


下一篇:yum安装时出现:Cannot retrieve metalink for repository epel. Please verify its path and try again