Building wheels for collected packages: cchardet, docopt
Building wheel for cchardet (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for cchardet (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [23 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-universal2-cpython-311
creating build/lib.macosx-10.9-universal2-cpython-311/cchardet
copying src/cchardet/version.py -> build/lib.macosx-10.9-universal2-cpython-311/cchardet
copying src/cchardet/__init__.py -> build/lib.macosx-10.9-universal2-cpython-311/cchardet
running build_ext
building 'cchardet._cchardet' extension
creating build/temp.macosx-10.9-universal2-cpython-311
creating build/temp.macosx-10.9-universal2-cpython-311/src
creating build/temp.macosx-10.9-universal2-cpython-311/src/cchardet
creating build/temp.macosx-10.9-universal2-cpython-311/src/ext
creating build/temp.macosx-10.9-universal2-cpython-311/src/ext/uchardet
creating build/temp.macosx-10.9-universal2-cpython-311/src/ext/uchardet/src
creating build/temp.macosx-10.9-universal2-cpython-311/src/ext/uchardet/src/LangModels
clang++ -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -Isrc/ext/uchardet/src -I/Users/kw/Documents/Projects/python3/proj/magic-html/venv/include -I/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c src/cchardet/_cchardet.cpp -o build/temp.macosx-10.9-universal2-cpython-311/src/cchardet/_cchardet.o
src/cchardet/_cchardet.cpp:196:12: fatal error: 'longintrepr.h' file not found
#include "longintrepr.h"
^~~~~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/clang++' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for cchardet
可否把
magic-html/requirements.txt
Line 2 in 1c44bd5
改为
cchardet==2.2.0a2(见这个 issue)?否则在 python3.11 下报错。我显式指定安装cchardet==2.2.0a2后可以正常运行 README 里的例子。报错信息如下: