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

cchardet doesn't seem to work on python 3.10 #6788

Closed
1 task done
encryptize opened this issue Jun 12, 2022 · 3 comments
Closed
1 task done

cchardet doesn't seem to work on python 3.10 #6788

encryptize opened this issue Jun 12, 2022 · 3 comments
Labels

Comments

@encryptize
Copy link

Describe the bug

aiohttp[speedups] cannot be installed on python 3.10 because cChardet 2.1.7 does not work on this python version.
PyYoshi/cChardet#77

To Reproduce

  1. Run pip install aiohttp[speedups] with python 3.10

  2. An error occurs

Expected behavior

Just installing aiohttp[speedups] without issue.

Logs/tracebacks

$ pip install aiohttp[speedups]
Collecting aiohttp[speedups]
  Using cached aiohttp-3.8.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.2 MB)
Collecting charset-normalizer<3.0,>=2.0
  Using cached charset_normalizer-2.0.12-py3-none-any.whl (39 kB)
Collecting async-timeout<5.0,>=4.0.0a3
  Using cached async_timeout-4.0.2-py3-none-any.whl (5.8 kB)
Collecting aiosignal>=1.1.2
  Using cached aiosignal-1.2.0-py3-none-any.whl (8.2 kB)
Collecting multidict<7.0,>=4.5
  Using cached multidict-6.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (114 kB)
Collecting frozenlist>=1.1.1
  Using cached frozenlist-1.3.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (157 kB)
Collecting attrs>=17.3.0
  Using cached attrs-21.4.0-py2.py3-none-any.whl (60 kB)
Collecting yarl<2.0,>=1.0
  Using cached yarl-1.7.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (305 kB)
Collecting aiodns
  Using cached aiodns-3.0.0-py3-none-any.whl (5.0 kB)
Collecting Brotli
  Using cached Brotli-1.0.9-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (2.7 MB)
Collecting cchardet
  Using cached cchardet-2.1.7.tar.gz (653 kB)
  Preparing metadata (setup.py) ... done
Collecting idna>=2.0
  Using cached idna-3.3-py3-none-any.whl (61 kB)
Collecting pycares>=4.0.0
  Using cached pycares-4.1.2-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (291 kB)
Collecting cffi>=1.5.0
  Using cached cffi-1.15.0-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (446 kB)
Collecting pycparser
  Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
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
  ╰─> [21 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.10
      creating build/lib.linux-x86_64-3.10/cchardet
      copying src/cchardet/version.py -> build/lib.linux-x86_64-3.10/cchardet
      copying src/cchardet/__init__.py -> build/lib.linux-x86_64-3.10/cchardet
      running build_ext
      building 'cchardet._cchardet' extension
      creating build/temp.linux-x86_64-3.10
      creating build/temp.linux-x86_64-3.10/src
      creating build/temp.linux-x86_64-3.10/src/cchardet
      creating build/temp.linux-x86_64-3.10/src/ext
      creating build/temp.linux-x86_64-3.10/src/ext/uchardet
      creating build/temp.linux-x86_64-3.10/src/ext/uchardet/src
      creating build/temp.linux-x86_64-3.10/src/ext/uchardet/src/LangModels
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Isrc/ext/uchardet/src -I/home/rjakub/sandbox/aiohttp/venv/include -I/usr/include/python3.10 -c src/cchardet/_cchardet.cpp -o build/temp.linux-x86_64-3.10/src/cchardet/_cchardet.o
      x86_64-linux-gnu-gcc: fatal error: cannot execute ‘cc1plus’: execvp: No such file or directory
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-gcc' 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
  Running setup.py clean for cchardet
Failed to build cchardet
Installing collected packages: cchardet, Brotli, pycparser, multidict, idna, frozenlist, charset-normalizer, attrs, async-timeout, yarl, cffi, aiosignal, pycares, aiohttp, aiodns
  Running setup.py install for cchardet ... error
  error: subprocess-exited-with-error

  × Running setup.py install for cchardet did not run successfully.
  │ exit code: 1
  ╰─> [23 lines of output]
      running install
      /home/rjakub/sandbox/aiohttp/venv/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.10
      creating build/lib.linux-x86_64-3.10/cchardet
      copying src/cchardet/version.py -> build/lib.linux-x86_64-3.10/cchardet
      copying src/cchardet/__init__.py -> build/lib.linux-x86_64-3.10/cchardet
      running build_ext
      building 'cchardet._cchardet' extension
      creating build/temp.linux-x86_64-3.10
      creating build/temp.linux-x86_64-3.10/src
      creating build/temp.linux-x86_64-3.10/src/cchardet
      creating build/temp.linux-x86_64-3.10/src/ext
      creating build/temp.linux-x86_64-3.10/src/ext/uchardet
      creating build/temp.linux-x86_64-3.10/src/ext/uchardet/src
      creating build/temp.linux-x86_64-3.10/src/ext/uchardet/src/LangModels
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Isrc/ext/uchardet/src -I/home/rjakub/sandbox/aiohttp/venv/include -I/usr/include/python3.10 -c src/cchardet/_cchardet.cpp -o build/temp.linux-x86_64-3.10/src/cchardet/_cchardet.o
      x86_64-linux-gnu-gcc: fatal error: cannot execute ‘cc1plus’: execvp: No such file or directory
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> cchardet

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

Python Version

$ python --version
Python 3.10.4

aiohttp Version

$ python -m pip show aiohttp
WARNING: Package(s) not found: aiohttp

multidict Version

$ python -m pip show multidict
WARNING: Package(s) not found: multidict

yarl Version

$ python -m pip show yarl
WARNING: Package(s) not found: yarl

OS

Ubuntu 22.04

Related component

Client

Additional context

No response

Code of Conduct

  • I agree to follow the aio-libs Code of Conduct
@encryptize encryptize added the bug label Jun 12, 2022
@encryptize
Copy link
Author

My bad, I forgot about g++ and python3-dev. I'm closing issue.

@ooliver1
Copy link

this does need some thought for aiohttp though, cchardet has been unmaintained for over a year now despite it not fully supporting 3.10 (requiring gcc builds)

@ooliver1
Copy link

Use latest aiohttp where cchardet isn't even used: https://github.com/aio-libs/aiohttp/blob/master/setup.cfg#L68

With 3.10, you can install the C++ devtools / gcc / ..., depending on your operating system, but with 3.11 cchardet is incompatible.

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

No branches or pull requests

2 participants