error: Microsoft Visual C++ 14.0 or greater is required.

文章讲述了用户在尝试安装和配置xformers库时遇到的关于MicrosoftVisualC++14.0版本不兼容的错误,提供了解决方案,包括下载并安装VisualC++BuildTools,以及检查系统版本并选择兼容选项。
摘要由CSDN通过智能技术生成

复现StableDiffusion的时候在配置环境遇到xformer的这个报错:

Installing collected packages: xformers
  Running setup.py develop for xformers
    error: subprocess-exited-with-error
    
    × python setup.py develop did not run successfully.
    │ exit code: 1
    ╰─> [26 lines of output]
        running develop
        running egg_info
        writing xformers.egg-info\PKG-INFO
        writing dependency_links to xformers.egg-info\dependency_links.txt
        writing requirements to xformers.egg-info\requires.txt
        writing top-level names to xformers.egg-info\top_level.txt
        reading manifest file 'xformers.egg-info\SOURCES.txt'
        reading manifest template 'MANIFEST.in'
        warning: no files found matching 'third_party\flash-attention\version.txt'
        warning: manifest_maker: MANIFEST.in, line 13: path 'third_party/flash-attention/csrc/cutlass/docs/' cannot end with '/'

        warning: manifest_maker: MANIFEST.in, line 14: path 'third_party/flash-attention/csrc/cutlass/test/' cannot end with '/'

        warning: manifest_maker: MANIFEST.in, line 15: path 'third_party/flash-attention/csrc/cutlass/tools/' cannot end with '/'

        warning: manifest_maker: MANIFEST.in, line 16: path 'third_party/flash-attention/csrc/cutlass/media/' cannot end with '/'

        warning: manifest_maker: MANIFEST.in, line 17: path 'third_party/flash-attention/csrc/cutlass/python/' cannot end with '/'

        adding license file 'LICENSE'
        writing manifest file 'xformers.egg-info\SOURCES.txt'
        running build_ext
        ···
          warnings.warn(f'Error checking compiler version for {compiler}: {error}')
        building 'xformers._C' extension
        error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
        [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

解决方法:

安装Microsoft Visual C++ 14.0 or greater

网址如下:

https://visualstudio.microsoft.com/zh-hans/visual-cpp-build-tools/

下载生成工具,之后双击打开 vs_BuildTools.exe

通过win+r,输入winver查看系统版本

我的是这样:

在下载工具勾选

右方勾选兼容的版本即可

解决效果:

Installing collected packages: xformers
  Running setup.py develop for xformers
Successfully installed xformers-0.0.25+de5e5b9.d20240215

  • 11
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值