由於現在python的2.x版本不再維護,實際很多依賴都是3.x的,這里簡單介紹一下cento環境如何安裝pip3命令.
安裝:
yum install -y python3-pip
配置鏡像加速:
nano /root/.pip/pip.conf
這里root是你要安裝的登錄用戶主目錄
pip.conf文件內容
[global]
#index-url=http://mirrors.aliyun.com/pypi/simple/
index-url= https://pypi.tuna.tsinghua.edu.cn/simple
[install]
#trusted-host=mirrors.aliyun.com
trusted-host=pypi.tuna.tsinghua.edu.cn
查看是否安裝成功:
[root@izm5e0cjxe9c7jek2izwafz ~]# pip3 -V
pip 9.0.3 from /usr/lib/python3.6/site-packages (python 3.6)