ERROR: Failed building wheel for cython_bbox | pip install cython_bbox 失败【解决方案】
🥇 版权: 本文由【墨理学AI】原创首发、各位读者大大、敬请查阅、感谢三连
🎉 声明: 作为全网 AI 领域 干货最多的博主之一,❤️ 不负光阴不负卿 ❤️
文章目录
- win11 系统 pip3 install cython_bbox 失败报错如下
- 解决方法:1 下载源代码 2 安装 Visual Studio 来支持 这个库的编译
- 1 下载源码
- 2 安装 Visual Studio 来支持 这个库的编译
- 3 修改 setup.py
- 4 python setup.py build_ext install 【即可安装成功】
- 类似的 pip install ecyglpki 报错
- 主要有效参考博文如下
- ❤️ 人生苦短, 欢迎和墨理一起学AI
win11 系统 pip3 install cython_bbox 失败报错如下
- conda install cython_bbox 也失败了
- pip3 install cython_bbox
error: Microsoft Visual C++ 14.0 or greater is required.
ERROR: Failed building wheel for cython_bbox
Running setup.py clean for cython_bbox
Failed to build cython_bbox
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (cython_bbox)
解决方法:1 下载源代码 2 安装 Visual Studio 来支持 这个库的编译
1 下载源码
- https://pypi.org/project/cython-bbox/0.1.5/
2 安装 Visual Studio 来支持 这个库的编译
- 官网下载链接 - 下载 社区版本即可
- https://visualstudio.microsoft.com/zh-hans/downloads/
- 下载之后双击安装,选择需要的组件安装即可(不然占据的磁盘空间会非常大)
我选择的具体安装模块如下
- C++ 桌面开发 模块 最下面几个 v143 生成工具 这几个选项 得选上(第一次我没选,结构依然 编译失败了)
3 修改 setup.py
cd D:\x\track\cython_bbox-0.1.5
vi setup.py
# 修改如下
compile_args = {'gcc': ['/Qstd=c99']}
4 python setup.py build_ext install 【即可安装成功】
conda env list
conda activate yolo10
cd D:\x\track\cython_bbox-0.1.5
python setup.py build_ext install
安装成功输出如下
python setup.py build_ext install
D:\x\anconda\envs\yolo10\lib\site-packages\setuptools\__init__.py:94: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
!!
********************************************************************************
Requirements should be satisfied by a PEP 517 installer.
If you are using pip, you can try `pip install --use-pep517`.
********************************************************************************
!!
dist.fetch_build_eggs(dist.setup_requires)
running build_ext
building 'cython_bbox' extension
"D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -ID:\x\anconda\envs\yolo10\lib\site-packages\numpy\core\include -ID:\x\anconda\envs\yolo10\include -ID:\x\anconda\envs\yolo10\Include "-ID:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include" "-ID:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\ATLMFC\include" "-ID:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-ID:\Windows Kits\10\include\10.0.22621.0\ucrt" "-ID:\Windows Kits\10\\include\10.0.22621.0\\um" "-ID:\Windows Kits\10\\include\10.0.22621.0\\shared" "-ID:\Windows Kits\10\\include\10.0.22621.0\\winrt" "-ID:\Windows Kits\10\\include\10.0.22621.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcsrc/cython_bbox.c /Fobuild\temp.win-amd64-cpython-39\Release\src/cython_bbox.obj gcc
cl: 命令行 warning D9024 :无法识别的源文件类型“gcc”,假定为对象文件
cl: 命令行 warning D9027 :源文件“gcc”被忽略
cython_bbox.c
D:\xanconda\envs\yolo10\lib\site-packages\numpy\core\include\numpy\npy_1_7_deprecated_api.h(14) : Warning Msg: Using deprecated NumPy API, disable it with #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
src/cython_bbox.c(4473): warning C4244: “=”: 从“npy_intp”转换到“unsigned int”,可能丢失数据
src/cython_bbox.c(4483): warning C4244: “=”: 从“npy_intp”转换到“unsigned int”,可能丢失数据
creating D:\x\track\cython_bbox-0.1.5\build\lib.win-amd64-cpython-39
"D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\HostX86\x64\link.exe" /nologo /INCREMENTAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO /LIBPATH:D:\x\anconda\envs\yolo10\libs /LIBPATH:D:\x\anconda\envs\yolo10 /LIBPATH:D:\x\anconda\envs\yolo10\PCbuild\amd64 "/LIBPATH:D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\ATLMFC\lib\x64" "/LIBPATH:D:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\lib\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64" "/LIBPATH:D:\Windows Kits\10\lib\10.0.22621.0\ucrt\x64" "/LIBPATH:D:\Windows Kits\10\\lib\10.0.22621.0\\um\x64" /EXPORT:PyInit_cython_bbox build\temp.win-amd64-cpython-39\Release\src/cython_bbox.obj /OUT:build\lib.win-amd64-cpython-39\cython_bbox.cp39-win_amd64.pyd /IMPLIB:build\temp.win-amd64-cpython-39\Release\src\cython_bbox.cp39-win_amd64.lib
正在创建库 build\temp.win-amd64-cpython-39\Release\src\cython_bbox.cp39-win_amd64.lib 和对象 build\temp.win-amd64-cpython-39\Release\src\cython_bbox.cp39-win_amd64.exp
正在生成代码
已完成代码的生成
running install
D:\x\anconda\envs\yolo10\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 or other
standards-based tools.
See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
********************************************************************************
!!
self.initialize_options()
D:\x\anconda\envs\yolo10\lib\site-packages\setuptools\_distutils\cmd.py:66: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!
********************************************************************************
Please avoid running ``setup.py`` and ``easy_install``.
Instead, use pypa/build, pypa/installer or other
standards-based tools.
See https://github.com/pypa/setuptools/issues/917 for details.
********************************************************************************
!!
self.initialize_options()
running bdist_egg
running egg_info
writing cython_bbox.egg-info\PKG-INFO
writing dependency_links to cython_bbox.egg-info\dependency_links.txt
writing requirements to cython_bbox.egg-info\requires.txt
writing top-level names to cython_bbox.egg-info\top_level.txt
reading manifest file 'cython_bbox.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE'
writing manifest file 'cython_bbox.egg-info\SOURCES.txt'
installing library code to build\bdist.win-amd64\egg
running install_lib
creating build\bdist.win-amd64
creating build\bdist.win-amd64\egg
copying build\lib.win-amd64-cpython-39\cython_bbox.cp39-win_amd64.pyd -> build\bdist.win-amd64\egg
creating stub loader for cython_bbox.cp39-win_amd64.pyd
byte-compiling build\bdist.win-amd64\egg\cython_bbox.py to cython_bbox.cpython-39.pyc
creating build\bdist.win-amd64\egg\EGG-INFO
copying cython_bbox.egg-info\PKG-INFO -> build\bdist.win-amd64\egg\EGG-INFO
copying cython_bbox.egg-info\SOURCES.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying cython_bbox.egg-info\dependency_links.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying cython_bbox.egg-info\requires.txt -> build\bdist.win-amd64\egg\EGG-INFO
copying cython_bbox.egg-info\top_level.txt -> build\bdist.win-amd64\egg\EGG-INFO
writing build\bdist.win-amd64\egg\EGG-INFO\native_libs.txt
zip_safe flag not set; analyzing archive contents...
__pycache__.cython_bbox.cpython-39: module references __file__
creating dist
creating 'dist\cython_bbox-0.1.5-py3.9-win-amd64.egg' and adding 'build\bdist.win-amd64\egg' to it
removing 'build\bdist.win-amd64\egg' (and everything under it)
Processing cython_bbox-0.1.5-py3.9-win-amd64.egg
creating d:\x\anconda\envs\yolo10\lib\site-packages\cython_bbox-0.1.5-py3.9-win-amd64.egg
Extracting cython_bbox-0.1.5-py3.9-win-amd64.egg to d:\x\anconda\envs\yolo10\lib\site-packages
Adding cython-bbox 0.1.5 to easy-install.pth file
Installed d:\x\anconda\envs\yolo10\lib\site-packages\cython_bbox-0.1.5-py3.9-win-amd64.egg
Processing dependencies for cython-bbox==0.1.5
Searching for numpy==1.26.4
Best match: numpy 1.26.4
Adding numpy 1.26.4 to easy-install.pth file
detected new path './cython_bbox-0.1.5-py3.9-win-amd64.egg'
Installing f2py-script.py script to D:\x\anconda\envs\yolo10\Scripts
Installing f2py.exe script to D:\x\anconda\envs\yolo10\Scripts
Using d:\x\anconda\envs\yolo10\lib\site-packages
Searching for Cython==3.0.11
Best match: Cython 3.0.11
Adding Cython 3.0.11 to easy-install.pth file
Installing cygdb-script.py script to D:\x\anconda\envs\yolo10\Scripts
Installing cygdb.exe script to D:\x\anconda\envs\yolo10\Scripts
Installing cython-script.py script to D:\x\anconda\envs\yolo10\Scripts
Installing cython.exe script to D:\x\anconda\envs\yolo10\Scripts
Installing cythonize-script.py script to D:\x\anconda\envs\yolo10\Scripts
Installing cythonize.exe script to D:\x\anconda\envs\yolo10\Scripts
Using d:\x\anconda\envs\yolo10\lib\site-packages
Finished processing dependencies for cython-bbox==0.1.5
类似的 pip install ecyglpki 报错
- pip install ecyglpki 安装时报错,解决方法: 下载这个库的 .whl 格式安装包 然后 pip install ** .whl
主要有效参考博文如下
- 安装cython—bbox流程与可能遇到的问题
❤️ 人生苦短, 欢迎和墨理一起学AI
- 🎉 作为全网 AI 领域 干货最多的博主之一,❤️ 不负光阴不负卿 ❤️
- ❤️ 如果文章对你有些许帮助、蟹蟹各位读者大大点赞、评论鼓励博主的每一分认真创作