Windows pip install -r requirements.txt 太慢

目录

解决方案一:

解决方案二:

下载单个包时切换源:


解决方案一:

1、在虚拟环境中切换下载的源:

复制代码
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

2、当出现有pip.txt文件写入时,再执行pip安装

复制代码
pip install -r requirements.txt 

解决方案二:

1、在 C:\Users\All Users目录下创建pip文件夹,pip文件中创建pip.ini文件

2、编辑文件内容:

复制代码
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com

一些镜像地址:

清华大学:https://pypi.tuna.tsinghua.edu.cn/simple/

  阿里云:http://mirrors.aliyun.com/pypi/simple/

  中国科技大学:https://pypi.mirrors.ustc.edu.cn/simple/

  豆瓣(douban):http://pypi.douban.com/simple/

3、再进行安装

复制代码
pip install -r requirements.txt 

下载单个包时切换源:

复制代码
pip install somepackage -i https://pypi.tuna.tsinghua.edu.cn/simple/

执行pip install -r requirements.txt 时'gbk'报错:

UnicodeDecodeError: 'gbk' codec can't decode byte 0xa8 in position 187: illegal multibyte sequence

解决方法:

单击上图绿色的路径(错误信息中的文件:lib\site-packages\pip_internal\utils\encoding.py) ,找到报错的行,给decode函数添加参数'ignore',:

相关推荐
qq_316411031 天前
腹腔镜模拟手术训练数字化管理平台构建
人工智能·python·深度学习·机器学习
卷无止境1 天前
PageIndex:把RAG的检索逻辑从"找相似"改成了"讲道理"
后端·python
卷无止境1 天前
什么是VoxCPM2?一场TTS架构的彻底重构
后端·python
kisloy1 天前
【爬虫入门第5讲】Python爬虫文本解析详解
开发语言·爬虫·python
神经蛙19961 天前
🌍 别再硬编码中文了!Python Web 项目国际化(i18n)完全指南
后端·python
颜酱1 天前
14 | 验证并修正 LLM 生成的 SQL
人工智能·python
颜酱1 天前
13 | 使用 LangChain 生成 SQL
人工智能·python·langchain
不明觉厉二十年1 天前
uv Windows配置
conda·pip
PieroPc1 天前
Python 写的 Windows凭据添加工具 第二版 解决Win11 23H2, 25H2,26H1,共享文件和打印 一部份问题,不是全部!
开发语言·windows·python
颜酱1 天前
12 | 组装 SQL 生成上下文
人工智能·python