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

在 macOS python3.11 下安装报错 #15

Open
kkew3 opened this issue Sep 9, 2024 · 3 comments
Open

在 macOS python3.11 下安装报错 #15

kkew3 opened this issue Sep 9, 2024 · 3 comments

Comments

@kkew3
Copy link

kkew3 commented Sep 9, 2024

可否把

改为 cchardet==2.2.0a2(见这个 issue)?否则在 python3.11 下报错。我显式指定安装 cchardet==2.2.0a2 后可以正常运行 README 里的例子。

报错信息如下:

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

sixgad commented Sep 10, 2024

@kkew3 感谢Kaiwen的建议,cchardet==2.2.0a2当前是预发布版本,下阶段抽取任务大规模验证后更新上线。

@Tendo33
Copy link

Tendo33 commented Sep 23, 2024

Same problem here. I can't even install it now.

@sixgad
Copy link
Collaborator

sixgad commented Sep 23, 2024

@Tendo33 If the issue is that cchardet cannot compile in a higher version Python environment, you can try specifying the installation of cchardet alpha version.
The specific steps are as follows:

  1. pip install cchardet==2.2.0a2
  2. pip install https://github.com/opendatalab/magic-html/releases/download/magic_html-0.1.2-released/magic_html-0.1.2-py3-none-any.whl

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

3 participants