报错!error: subprocess-exited-with-error python setup.py bdist
报错!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下载包总有几个要手动下载安装。
本文来自网络,不代表协通编程立场,如若转载,请注明出处:https://net2asp.com/bee0df821f.html
