Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wlk-menglan opened this issue Jul 26, 2024 · 5 comments
Open

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

wlk-menglan opened this issue Jul 26, 2024 · 5 comments

Comments

@wlk-menglan
Copy link

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
Copy link

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

@wlk-menglan
Copy link
Author

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
Copy link
Collaborator

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
Copy link

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

@PangDingPing
Copy link

错误信息表明,在尝试构建 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++ 代码所必需的。

按以上方法,成功解决!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants