(日常搬砖)windows 11 安装cython_bbox时,遇到问题‘error: Microsoft Visual C++ 14.0 or greater is required. ’解决方案

在Windows11上安装Cython_bbox时遇到MicrosoftVisualC++14.0缺失的问题。通过尝试直接使用pip安装和手动修改setup.py文件的方法仍然失败。最终解决方案是下载并安装MicrosoftVisualC++BuildTools,尽管过程中遇到了安装包损坏的问题,但通过下载特定的exe文件并成功安装,解决了这个问题。最后,Cython和cython_bbox都成功安装。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

windows 11 安装cython_bbox时,遇到问题‘error: Microsoft Visual C++ 14.0 or greater is required. ’解决方案

安装百度飞桨时,执行指令pip install -r requirements.txt,报错。
检查一下错误,发现无法用pip安装Cython和cython_bbox。
参考FairMOT | win10下cython-bbox安装的心酸之路

成功安装了Cython。
接下来尝试以下两种方案安装cython_bbox:

  1. 直接在终端执行pip install cython-bbox,报错,此法作废。
  2. 下载cython_bbox的安装包,cython_bbox,解压文件,在解压后的目录中,找到steup.py 文件,把extra_compile_args=[’-Wno-cpp’],修改为extra_compile_args = {‘gcc’: [’/Qstd=c99’]},之后保存,在解压后的文件夹执行python setup.py build_ext install

方案2执行指令之后,仍报错:
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/
在这里插入图片描述

到网上查了一下,一种解决方案是安装visual studio(太大了,选择C++桌面开发环境之后,大概要安装10多G的文件,C盘空间不够);另一种方案是下载visualcppbuildtools full.exe,安装 Microsoft Visual C++ 14.0。

接下来是最坑爹的!!
打开microsoft visual c++ build tools,选择默认安装方式之后,提示安装包丢失或损坏。
在这里插入图片描述
翻墙,获取管理员权限等都无法解决该问题。

若遇到以上问题,可下载解决microsoft visual c++ build tools安装包丢失或损坏
解压后直接运行exe文件即可。

运行exe文件后,看到下面画面:

在这里插入图片描述
看到这个画面太开心了!!

在这里插入图片描述
执行指令python setup.py build_ext install,安装成功。
安装成功
输入pip list,可以看到已安装好 Cython和cython_bbox
在这里插入图片描述

Building wheels for collected packages: cython_bbox Building wheel for cython_bbox (setup.py) ... error error: subprocess-exited-with-error × python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [5 lines of output] running bdist_wheel running build running build_ext building 'cython_bbox' 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: Failed building wheel for cython_bbox Running setup.py clean for cython_bbox Failed to build cython_bbox Installing collected packages: cython_bbox Running setup.py install for cython_bbox ... error error: subprocess-exited-with-error × Running setup.py install for cython_bbox did not run successfully. │ exit code: 1 ╰─> [18 lines of output] running install D:\python\envs\yolov578\lib\site-packages\setuptools\_distutils\cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated. !! ******************************************************************************** Please avoid running ``setup.py`` directly. Instead, use pypa/build, pypa/installer, pypa/build or other standards-based tools. See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details. ******************************************************************************** !! self.initialize_options() running build running build_ext building 'cython_bbox' 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: legacy-install-failure × Encountered error while trying to install package. ╰─> cython_bbox note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.
06-08
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值