Linux 安装依赖时报urllib3版本兼容冲突ERROR

批量安装依赖(requirements.txt)时报错:ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. botocore 1.29.126 requires urllib3<1.27,>=1.25.4, but you have urllib3 2.0.2 which is incompatible. requests 2.28.2 requires urllib3<1.27,>=1.21.1, but you have urllib3 2.0.2 which is incompatible

错误原因:可能是由于pip的依赖解析器未考虑到当前所安装的所有软件包,导致依赖冲突。

解决办法:

1. 更新pip

pip install --upgrade pip

2. 清理缓存,缓存中的旧依赖可能会导致冲突(本次解决方式)

pip cache purge

3. 显示安装指定版本依赖(不推荐,可能导致其他依赖版本冲突)

pip install package_name==version_number

4. 使用conda创建虚拟环境,隔离不同项目的依赖关系

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值