报错!error: subprocess-exited-with-error python setup.py bdist_wheel did not run successfully.

报错!error: subprocess-exited-with-error python setup.py bdist_wheel did not run successfully

这类问题有通用的解决方法。

问题背景

使用pip安装包时出粗:

pip install -r requirements.txt

报错原文:

Building wheels for collected packages: fastcache, pycosat
  Building wheel for fastcache (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [31 lines of output]

问题分析

这类问题有通用的解决方法,观察报错原文,是fastcache包下载出错,如果其他包下载出错也可以使用同样的方法解决

Building wheel for fastcache (setup.py) … error

对于这种问题,需要将包先下载到本地再使用pip进行安装。

问题解决

从下面地址下载包:Archived: Unofficial Windows Binaries for Python Extension Packages

下载时需要选择对应的python版本,观察英文字母cp之后的数字,以fastcache‑1.1.0‑cp38‑cp38‑win_amd64.whl为例,cp38‑cp38代表这个包适配的包的版本是Python3.8的(最后的数字代表适配的平台,有32位和64位,一般PC选择64位的下载就行):

如果上面的包对应的python版本选错了会出现如下报错:

ERROR: fastcache-1.1.0-cp27-cp27m-win_amd64.whl is not a supported wheel on this platform.

打开你要安装的环境的命令行,我这边使用的conda里面的tensorflow-gpu-v1的环境:

cd到你刚刚下载的文件的目录:

使用pip命令在本地进行包的安装,如:

pip install fastcache-1.1.0-cp38-cp38-win_amd64.whl

由此对应的包即可安装成功啦,每次从requirements下载包总有几个要手动下载安装。

版权声明:本文为博主作者:怡步晓心l原创文章,版权归属原作者,如果侵权,请联系我们删除!

原文链接:https://blog.csdn.net/weixin_44584198/article/details/134526191

共计人评分,平均

到目前为止还没有投票!成为第一位评论此文章。

(0)
乘风的头像乘风管理团队
上一篇 2024年5月6日
下一篇 2024年5月6日

相关推荐