多版本python下使用pip 发表于: 2017-07-14 2022-01-17 分类: SRE 标签: https, pip, python 安装python2和3 默认3 pip -V测试pip调用路径 在python2下查看pip路径 -m参数 相当于import,意味当作模块启动 文章导航 前一页 上一篇: 快速清除TIME_WAIT连接后一页 下一篇: TCP状态 admin 757RSS订阅
centos7下使用yum安装pip 首先安装epel扩展源: yum -y install epel-release 更新完成之后,就可安装pip: yum -y install python-pip 回复
pip国内的一些镜像 阿里云 http://mirrors.aliyun.com/pypi/simple/ 中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/ 豆瓣(douban) http://pypi.douban.com/simple/ 清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/ 中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/ 修改源方法: 临时使用: 可以在使用pip的时候在后面加上-i参数,指定pip源 eg: pip install scrapy -i https://pypi.tuna.tsinghua.edu.cn/simple 永久修改: linux: 修改 ~/.pip/pip.conf (没有就创建一个), 内容如下: [global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple 回复
pip install xxx -proxy http:127.0.0.1:1080 代理 在pip之前调用 set http_proxy=http://127.0.0.1:8087 不行可以试试下面的: set https_proxy=http://127.0.0.1:8087 回复
centos7下使用yum安装pip
首先安装epel扩展源:
yum -y install epel-release
更新完成之后,就可安装pip:
yum -y install python-pip
pip国内的一些镜像
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣(douban) http://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
修改源方法:
临时使用:
可以在使用pip的时候在后面加上-i参数,指定pip源
eg: pip install scrapy -i https://pypi.tuna.tsinghua.edu.cn/simple
永久修改:
linux:
修改 ~/.pip/pip.conf (没有就创建一个), 内容如下:
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
pip install xxx -proxy http:127.0.0.1:1080 代理
在pip之前调用
set http_proxy=http://127.0.0.1:8087
不行可以试试下面的:
set https_proxy=http://127.0.0.1:8087