Ubuntu 下 python 安装pip
背景
python的强大在于它的第三方库。
安装
python2
sudo apt-get install python-pip
python3
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py
更换源
为了加快
pip install
的速度。
源列表:
# 豆瓣
https://pypi.doubanio.com/simple/
# 阿里云
https://mirrors.aliyun.com/pypi/simple/
# 清华大学
https://pypi.tuna.tsinghua.edu.cn/simple/
https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple/
临时做法:
通过-i
指定使用某个源
pip install some-package -i https://mirrors.aliyun.com/pypi/simple/
永久固化到配置项
mkdir ~/.pip/ -p
echo "[global]\nindex-url = https://pypi.tuna.tsinghua.edu.cn/simple" > ~/.pip/pip.conf
如果说我的文章对你有用,只不过是我站在巨人的肩膀上再继续努力罢了。
若在页首无特别声明,本篇文章由 Schips 经过整理后发布。
博客地址:https://www.cnblogs.com/schips/
若在页首无特别声明,本篇文章由 Schips 经过整理后发布。
博客地址:https://www.cnblogs.com/schips/