使用pip install -r requirement.txt导入环境时需注意的问题

我们使用conda创建的虚拟环境时一般会先指定pyton版本。比如我一般喜欢指定python=3.8 。然后就通过工程中的requirement.txt文件导入剩下的环境,遇到了两个问题。

1、安装torch找不到对应的版本

Could not find a version that satisfies the requirement torch==1.4.0 (from -r requirements.txt (line 1)) (from versions: )No matching distribution found for torch==1.4.0 (from -r requirements.txt (line 1))
Could not find a version that satisfies the requirement torch1.4.0 (from -r requirements.txt (line 1)) (from versions: )
No matching distribution found for torch
1.4.0 (from -r requirements.txt (line 1))

2、然后尝试自己手动一个个安装

就又发现一个新的问题,会卡在
Building wheels for collected packages: pandas
Building wheel for pandas (setup.py) …
在这里插入图片描述
这个界面一直不动。

3、解决办法

搜索时偶然看到一个帖子说卡在图片2处可能是因为python版本不对
原文链接
于是尝试更换python版本为3.6,导入环境,仍报错图片1 的问题,尝试python=3.7,成功安装!
在这里插入图片描述
看到successfully我就放心啦。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值