网站制作学习网Python→正文:pip install慢
字体:

pip install慢

Python 2024/3/14 13:24:46  点击:不统计


 在使用python pip 安装扩展时很慢,由于源是国外的,所以很慢,下面我们说下解决方法:

 
1. 采用临时 指定源的方法
下面代码 -i 表示指定源地址, 后面则是要安装的扩展,以 autogen 为例子
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ autogen
如果是http 协议,则要加上 --trusted-host 
pip install -i http://pypi.tuna.tsinghua.edu.cn/simple/ autogen  --trusted-host  pypi.tuna.tsinghua.edu.cn
 
2. 永久替换源,这里替换为清华的源
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
 
 
3.常见源的镜像地址 
清华大学:https://pypi.tuna.tsinghua.edu.cn/simple/
阿里云:https://mirrors.aliyun.com/pypi/simple/
中科大:https://pypi.mirrors.ustc.edu.cn/simple/
 

·上一篇:RuntimeError: Your system has an unsupported version of sqlite3. Chrom >>    ·下一篇:python代码获取扩展版本 >>
推荐文章
最新文章