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

Fails to install on Python 3.11 because cchardet can't build #27

Open
aquatix opened this issue Sep 18, 2023 · 2 comments
Open

Fails to install on Python 3.11 because cchardet can't build #27

aquatix opened this issue Sep 18, 2023 · 2 comments

Comments

@aquatix
Copy link

aquatix commented Sep 18, 2023

On installing warcit in a python 3.11 venv, I get a compilation error:

      creating build/temp.linux-x86_64-cpython-311/src/ext/uchardet/src/LangModels
      x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -Isrc/ext/uchardet/src -I/home/mbscholt/.virtualenvs/divault-pyramid/include -I/usr/include/python3.11 -c src/cchardet/_cchardet.cpp -o build/temp.linux-x86_64-cpython-311/src/cchardet/_cchardet.o
      src/cchardet/_cchardet.cpp:196:12: fatal error: longintrepr.h: No such file or directory
        196 |   #include "longintrepr.h"
            |            ^~~~~~~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]

This is a known issue with cChardet: PyYoshi/cChardet#81 and has not been fixed since last year. It's unlikely that it will be fixed soon.

There are options to for example move to a fork at https://github.com/faust-streaming/cChardet but also updating to a recent Cython helps (tested): pip install --upgrade Cython. Maybe add the latter as a dependency for Python 3.11 and up?

@lasztoth
Copy link

The same issue occurs with Python 3.10.x. However, on Python 3.9 you can simply run python setup.py install to set everything up just fine.

You can use a venv/conda to set up a 3.9 environment easily.

@aquatix
Copy link
Author

aquatix commented Apr 17, 2024

Python 3.9 is not an option for us, as warcit has to work inside a bigger project that targets Python 3.10+

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

2 participants