Benjamin

静以修身,俭以养德,非澹薄无以明志,非宁静无以致远。
随笔 - 386, 文章 - 0, 评论 - 196, 引用 - 0
数据加载中……

pip install加快速度

一、pip install -i pip国内源
阿里云 https://mirrors.aliyun.com/pypi/simple/ 
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/ 
豆瓣(douban) https://pypi.douban.com/simple/ 
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/ 
中国科学技术大学 https://pypi.mirrors.ustc.edu.cn/simple/
二、配置文件更改pip源
1、windows:在c:\user(或者用户)\电脑的用户名\,目录下创建一个命名为“pip”的文件夹(如:C:\Users\Administrator\pip),在该文件夹下创建一个命名为“pip.ini”的文件,在该文件中写入以下内容:
[global]
index-url=https://pypi.tuna.tsinghua.edu.cn/simple 
[install]  
trusted-host=pypi.tuna.tsinghua.edu.cn
disable-pip-version-check = true  
timeout = 6000
2、linux: 修改 ~/.pip/pip.conf (没有就创建一个文件夹及文件。文件夹要加“.”,表示是隐藏文件夹)
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = https://pypi.tuna.tsinghua.edu.cn
命令行:
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple 或者
pip config set global.trusted-host https://pypi.tuna.tsinghua.edu.cn/simple
三、一次安装使用的临时方法,只对本地安装有效(pip -i参数)
pip install -i https://mirrors.aliyun.com/pypi/simple/   --阿里云
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple  --清华源

posted on 2021-08-21 15:31 Benjamin 阅读(387) 评论(0)  编辑 收藏 引用 所属分类: python


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理