opendatalab / magic-doc

Apache License 2.0
305 stars 22 forks source link

Building wheel for cchardet (setup.py) ... error #19

Open wlk-menglan opened 1 month ago

wlk-menglan commented 1 month ago

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

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [22 lines of output] running bdist_wheel running build running build_py creating build creating build\lib.win-amd64-cpython-311 creating build\lib.win-amd64-cpython-311\cchardet copying src\cchardet\version.py -> build\lib.win-amd64-cpython-311\cchardet copying src\cchardet__init__.py -> build\lib.win-amd64-cpython-311\cchardet running build_ext building 'cchardet._cchardet' extension creating build\temp.win-amd64-cpython-311 creating build\temp.win-amd64-cpython-311\Release creating build\temp.win-amd64-cpython-311\Release\src creating build\temp.win-amd64-cpython-311\Release\src\cchardet creating build\temp.win-amd64-cpython-311\Release\src\ext creating build\temp.win-amd64-cpython-311\Release\src\ext\uchardet creating build\temp.win-amd64-cpython-311\Release\src\ext\uchardet\src creating build\temp.win-amd64-cpython-311\Release\src\ext\uchardet\src\LangModels D:\VS2022\Community\VC\Tools\MSVC\14.37.32822\bin\HostX86\x64\cl.exe /c /nologo /O2 /W3 /GL /DNDEBUG /MD -Isrc/ext/uchardet/src -ID:\Anconda2 024\include -ID:\Anconda2024\Include -ID:\VS2022\Community\VC\Tools\MSVC\14.37.32822\include -ID:\VS2022\Community\VC\Tools\MSVC\14.37.32822\ATLMFC \include -ID:\VS2022\Community\VC\Auxiliary\VS\include "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt" "-IC:\Program Files (x8 6)\Windows Kits\10\include\10.0.22621.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\shared" "-IC:\Program Files (x86)\Wi ndows Kits\10\include\10.0.22621.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\cppwinrt" /EHsc /Tpsrc/cchardet_cchardet.cpp /Fobuild\temp.win-amd64-cpython-311\Release\src/cchardet_cchardet.obj _cchardet.cpp src/cchardet_cchardet.cpp(196): fatal error C1083: 无法打开包括文件: “longintrepr.h”: No such file or directory error: command 'D:\VS2022\Community\VC\Tools\MSVC\14.37.32822\bin\HostX86\x64\cl.exe' failed with exit code 2 [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for cchardet Running setup.py clean for cchardet Failed to build cchardet ERROR: Could not build wheels for cchardet, which is required to install pyproject.toml-based projects

XiyueSun commented 1 month ago

应该是python版本问题,按照readme切换成3.10

wlk-menglan commented 1 month ago

Preparing metadata (setup.py) ... error error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [1 lines of output] ERROR: Can not execute setup.py since setuptools is not available in the build environment. [end of output]

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

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details. 嗯嗯,版本好了之后现在报错这个

应该是python版本问题,按照readme切换成3.10

icecraft commented 1 month ago

Preparing metadata (setup.py) ... error error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [1 lines of output] ERROR: Can not execute setup.py since setuptools is not available in the build environment. [end of output]

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

× Encountered error while generating package metadata. ╰─> See above for output.

note: This is an issue with the package mentioned above, not pip. hint: See above for details. 嗯嗯,版本好了之后现在报错这个

应该是python版本问题,按照readme切换成3.10

using pip install fairy-doc[cpu]

PangDingPing commented 1 month ago

我也是这样 pip install fairy-doc[cpu] 也不行

PangDingPing commented 1 month ago

错误信息表明,在尝试构建 cchardet 包的 wheel 文件时失败了,具体是因为缺少 Microsoft Visual C++ 14.0 或更高版本。编译某些 Python 包(特别是包含 C 扩展的包)需要一个合适的 C++ 编译器。在 Windows 上,这通常意味着需要安装 Microsoft Visual C++ 构建工具。 安装 Microsoft C++ Build Tools:访问 Microsoft C++ Build Tools 网页,下载并安装适用于 Windows 的 C++ 构建工具。这将包括 MSVC 编译器和库,它们是编译 C++ 代码所必需的。

按以上方法,成功解决!