sedos-project / data_adapter_oemof

This respository holds the data adapters to connect oemof with the OEDatamodel-concrete.
GNU Affero General Public License v3.0
0 stars 1 forks source link

Python3.11 is not compatible with cchardet #11

Open nailend opened 1 year ago

nailend commented 1 year ago

Python3.11 is not compatible with cchardet, however cchardet is abandoned. More info here: https://bugzilla.redhat.com/show_bug.cgi?id=2021804

There is a fork fixing this https://github.com/faust-streaming/cChardet

However, I fixed python to <3.11 to solve the problem

Package operations: 28 installs, 2 updates, 0 removals

  • Updating cchardet (2.1.7 /home/conda/feedstock_root/build_artifacts/cchardet_1666947729218/work -> 2.1.7): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke build_wheel

  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-cpython-311
  creating build/lib.linux-x86_64-cpython-311/cchardet
  copying src/cchardet/__init__.py -> build/lib.linux-x86_64-cpython-311/cchardet
  copying src/cchardet/version.py -> build/lib.linux-x86_64-cpython-311/cchardet
  running build_ext
  building 'cchardet._cchardet' extension
  creating build/temp.linux-x86_64-cpython-311
  creating build/temp.linux-x86_64-cpython-311/src
  creating build/temp.linux-x86_64-cpython-311/src/cchardet
  creating build/temp.linux-x86_64-cpython-311/src/ext
  creating build/temp.linux-x86_64-cpython-311/src/ext/uchardet
  creating build/temp.linux-x86_64-cpython-311/src/ext/uchardet/src
  creating build/temp.linux-x86_64-cpython-311/src/ext/uchardet/src/LangModels
  gcc -pthread -B /home/local/RL-INSTITUT/julian.endres/miniconda3/envs/data_adapter_oemof/compiler_compat -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /home/local/RL-INSTITUT/julian.endres/miniconda3/envs/data_adapter_oemof/include -fPIC -O2 -isystem /home/local/RL-INSTITUT/julian.endres/miniconda3/envs/data_adapter_oemof/include -fPIC -Isrc/ext/uchardet/src -I/tmp/tmp2vekkp3q/.venv/include -I/home/local/RL-INSTITUT/julian.endres/miniconda3/envs/data_adapter_oemof/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: Datei oder Verzeichnis nicht gefunden
    196 |   #include "longintrepr.h"
        |            ^~~~~~~~~~~~~~~
  compilation terminated.
  error: command '/usr/bin/gcc' failed with exit code 1

  at ~/miniconda3/envs/data_adapter_oemof/lib/python3.11/site-packages/poetry/installation/chef.py:152 in _prepare
      148│ 
      149│                 error = ChefBuildError("\n\n".join(message_parts))
      150│ 
      151│             if error is not None:
    → 152│                 raise error from None
      153│ 
      154│             return path
      155│ 
      156│     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:

Note: This error originates from the build backend, and is likely not a problem with poetry but with cchardet (2.1.7) not supporting PEP 517 builds. You can verify this by running 'pip wheel --use-pep517 "cchardet (==2.1.7)"'.
henhuy commented 1 year ago

Thanks for fixing python version. This bug is coming from very old dependency tableschema. As tableschema has been replaced by frictionless, but frictionless is currently not working with oemof.tabular. Thus fixing python to <3.11 is the simpliest solution for now.