报错:subprocess-exited-with-error和Could not build wheels for ptflops, which is required to install pyp

报错一:参考pip安装软件包报错: error subprocess-exited-with-error问题记录_error: subprocess-exited-with-error 脳 pip subproce-CSDN博客

报错二:

进行论文复现时,需要安装pytorch和依赖requirements.txt,环境中pip install -r requirements.txt后,出现以上两个报错,主要为ptflops装不上,pip install ptflops无果。其中一个缺少库ujson,参考以下两篇文章,成功本地下载手动安装成功:Pytorch安装与Failed building wheel for XXX踩坑_failed building wheel for pytorch-CSDN博客

python解决Failed building wheel for XXX_failed building wheel for scikit-learn-CSDN博客

package下载地址Extension Packages

命令为:

pip install .wheel文件所在路径

但是ptflops一直下载无果,官网ptflops · PyPI只有一个集成版本的包,但是是23年发布的。之后到github上面搜索,找到了和我一样报错的话题failed to install · Issue #131 · sovrasov/flops-counter.pytorch (github.com)

最后使用命令:

pip install --upgrade git+https://github.com/sovrasov/flops-counter.pytorch.git

安装成功: 

 

 

  • 10
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值