bsolomon1124 / pycld3

Python3 bindings for the Compact Language Detector v3 (CLD3)
Apache License 2.0
149 stars 6 forks source link

cld3/pycld3.cpp:250:12: fatal error: 'longintrepr.h' file not found #35

Open yannis1962 opened 12 months ago

yannis1962 commented 12 months ago

When I try to install pycld3 under python3.11, I get

Collecting pycld3
  Using cached pycld3-0.22.tar.gz (726 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: pycld3
  Building wheel for pycld3 (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [24 lines of output]
      /Users/yannis/.asdf/installs/python/3.11.6/lib/python3.11/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
        warnings.warn(msg, warning_class)
      running bdist_wheel
      running build
      Running protoc sentence.proto feature_extractor.proto task_spec.proto --cpp_out=/private/var/folders/1n/fvs3dd2d5gqghwcw8khb41_h0000gn/T/pip-install-8vgx__mm/pycld3_edba16f2021b4244a8cab9a9f11eca98/src/cld_3/protos/
      running build_py
      creating build
      creating build/lib.macosx-13.5-x86_64-cpython-311
      creating build/lib.macosx-13.5-x86_64-cpython-311/cld3
      copying cld3/__init__.py -> build/lib.macosx-13.5-x86_64-cpython-311/cld3
      running build_ext
      building 'cld3._cld3' extension
      creating build/temp.macosx-13.5-x86_64-cpython-311
      creating build/temp.macosx-13.5-x86_64-cpython-311/cld3
      creating build/temp.macosx-13.5-x86_64-cpython-311/src
      creating build/temp.macosx-13.5-x86_64-cpython-311/src/cld_3
      creating build/temp.macosx-13.5-x86_64-cpython-311/src/cld_3/protos
      creating build/temp.macosx-13.5-x86_64-cpython-311/src/script_span
      clang -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/usr/local/include/ -I/private/var/folders/1n/fvs3dd2d5gqghwcw8khb41_h0000gn/T/pip-install-8vgx__mm/pycld3_edba16f2021b4244a8cab9a9f11eca98/src/ -I/private/var/folders/1n/fvs3dd2d5gqghwcw8khb41_h0000gn/T/pip-install-8vgx__mm/pycld3_edba16f2021b4244a8cab9a9f11eca98/src/cld_3/protos/ -I/Users/yannis/.asdf/installs/python/3.11.6/include/python3.11 -c cld3/pycld3.cpp -o build/temp.macosx-13.5-x86_64-cpython-311/cld3/pycld3.o -std=c++11 -stdlib=libc++
      cld3/pycld3.cpp:250: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 pycld3
  Running setup.py clean for pycld3
Failed to build pycld3
ERROR: Could not build wheels for pycld3, which is required to install pyproject.toml-based projects

What am I doing wrong?

yannis1962 commented 12 months ago

I noticed that other packages have the same problem: https://github.com/aio-libs/aiohttp/issues/6600

SteveClement commented 10 months ago

This is related to Python 3.11, workaround: use Python 3.10

basically #include "longintrepr.h" is not needed anymore as it is provided by Python.h

mr2dark commented 7 months ago

I've migrated to the recommendedgcld3 package after all attempts to work around various Python 3.11 build issues. I've managed to build gcld3 for Python 3.11.

mr2dark commented 7 months ago

For the record, in my case on Debian 12 gcld3 needs the libprotobuf32 package to run. The following packages are needed to build/install gcld3:

KIC commented 2 weeks ago

I've migrated to the recommendedgcld3 package after all attempts to work around various Python 3.11 build issues. I've managed to build gcld3 for Python 3.11.

I still have the longintrepr.h error, how did you manage to get it installed on python 3.11?

mr2dark commented 2 weeks ago

I still have the longintrepr.h error, how did you manage to get it installed on python 3.11?

Which package do you try to install when you get the longintrepr.h error?

KIC commented 2 weeks ago

python --version

Python 3.11.10

python -m pip install -U pycld3

     cld3/pycld3.cpp:250:12: fatal error: longintrepr.h: No such file or directory
        250 |   #include "longintrepr.h"
            |            ^~~~~~~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]
mr2dark commented 2 weeks ago

pycld3 won't work with Python 3.11. Please migrate to another package named gcld3.

KIC commented 1 week ago

Thanks that worked, sorry this was confusing i thought gcld3 is the "old" package. However, thank you very much!!