CAMeL-Lab / camel_tools

A suite of Arabic natural language processing tools developed by the CAMeL Lab at New York University Abu Dhabi.
MIT License
403 stars 71 forks source link

[BUG] Can't install Camel-tools using pip command #124

Open AhsAlharthi opened 1 year ago

AhsAlharthi commented 1 year ago

When using the pip command to install camel-tools it fails and return the following error:

ERROR: Failed building wheel for camel-kenlm Failed to build camel-kenlm ERROR: Could not build wheels for camel-kenlm, which is required to install pyproject.toml-based projects<

I tried to install it on new environments using Python 3.8 and 3.10, I also tried installing it using pip command from source and encountered the same issue.

``

  Building wheels for collected packages: camel-kenlm
  Building wheel for camel-kenlm (pyproject.toml) ... error
  error: subprocess-exited-with-error

  �� Building wheel for camel-kenlm (pyproject.toml) did not run successfully.
  ��� exit code: 1
  ������> [97 lines of output]
      Will build with KenLM max_order set to 6
      running bdist_wheel
      running build
      running build_ext
      CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
        Compatibility with CMake < 3.5 will be removed from a future version of
        CMake.

        Update the VERSION argument <min> value or use a ...<max> suffix to tell
        CMake that the project does not need compatibility with older versions.

      -- The C compiler identification is unknown
      -- The CXX compiler identification is unknown
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - failed
      -- Check for working C compiler: /usr/bin/cc
      -- Check for working C compiler: /usr/bin/cc - broken
      CMake Error at /tmp/pip-build-env-iwtsua6u/overlay/lib/python3.10/site-packages/cmake/data/share/cmake-3.27/Modules/CMakeTestCCompiler.cmake:67 (message):
        The C compiler

          "/usr/bin/cc"

        is not able to compile a simple test program.

        It fails with the following output:

          Change Dir: '/tmp/pip-install-x5sag72h/camel-kenlm_f21250b547e64787ac49ea1957c86964/build/temp.linux-x86_64-cpython-310/CMakeFiles/CMakeScratch/TryCompile-w2l3No'

          Run Build Command(s): /tmp/pip-build-env-iwtsua6u/overlay/lib/python3.10/site-packages/cmake/data/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_5d8ce/fast
          /usr/bin/gmake  -f CMakeFiles/cmTC_5d8ce.dir/build.make CMakeFiles/cmTC_5d8ce.dir/build
          gmake[1]: Entering directory '/tmp/pip-install-x5sag72h/camel-kenlm_f21250b547e64787ac49ea1957c86964/build/temp.linux-x86_64-cpython-310/CMakeFiles/CMakeScratch/TryCompile-w2l3No'
          Building C object CMakeFiles/cmTC_5d8ce.dir/testCCompiler.c.o
          /usr/bin/cc    -o CMakeFiles/cmTC_5d8ce.dir/testCCompiler.c.o -c /tmp/pip-install-x5sag72h/camel-kenlm_f21250b547e64787ac49ea1957c86964/build/temp.linux-x86_64-cpython-310/CMakeFiles/CMakeScratch/TryCompile-w2l3No/testCCompiler.c
          cc: error trying to exec 'cc1': execvp: No such file or directory
          gmake[1]: *** [CMakeFiles/cmTC_5d8ce.dir/build.make:78: CMakeFiles/cmTC_5d8ce.dir/testCCompiler.c.o] Error 1
          gmake[1]: Leaving directory '/tmp/pip-install-x5sag72h/camel-kenlm_f21250b547e64787ac49ea1957c86964/build/temp.linux-x86_64-cpython-310/CMakeFiles/CMakeScratch/TryCompile-w2l3No'
          gmake: *** [Makefile:127: cmTC_5d8ce/fast] Error 2

        CMake will not be able to correctly generate this project.
      Call Stack (most recent call first):
        CMakeLists.txt:14 (project)

      -- Configuring incomplete, errors occurred!
      Traceback (most recent call last):
        File "/home/ali.alharthi/.conda/envs/as1b/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/ali.alharthi/.conda/envs/as1b/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/ali.alharthi/.conda/envs/as1b/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
        File "/tmp/pip-build-env-iwtsua6u/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 434, in build_wheel
          return self._build_with_temp_dir(
        File "/tmp/pip-build-env-iwtsua6u/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 419, in _build_with_temp_dir
          self.run_setup()
        File "/tmp/pip-build-env-iwtsua6u/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 507, in run_setup
          super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-iwtsua6u/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 341, in run_setup
          exec(code, locals())
        File "<string>", line 123, in <module>
        File "/tmp/pip-build-env-iwtsua6u/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 103, in setup
          return distutils.core.setup(**attrs)
        File "/tmp/pip-build-env-iwtsua6u/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
        File "/tmp/pip-build-env-iwtsua6u/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/tmp/pip-build-env-iwtsua6u/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/tmp/pip-build-env-iwtsua6u/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 989, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-iwtsua6u/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-iwtsua6u/overlay/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 364, in run
          self.run_command("build")
        File "/tmp/pip-build-env-iwtsua6u/overlay/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-iwtsua6u/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 989, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-iwtsua6u/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-iwtsua6u/overlay/lib/python3.10/site-packages/setuptools/_distutils/command/build.py", line 131, in run
          self.run_command(cmd_name)
        File "/tmp/pip-build-env-iwtsua6u/overlay/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-iwtsua6u/overlay/lib/python3.10/site-packages/setuptools/dist.py", line 989, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-iwtsua6u/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "<string>", line 104, in run
        File "/home/ali.alharthi/.conda/envs/as1b/lib/python3.10/subprocess.py", line 369, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['cmake', '/tmp/pip-install-x5sag72h/camel-kenlm_f21250b547e64787ac49ea1957c86964', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/tmp/pip-install-x5sag72h/camel-kenlm_f21250b547e64787ac49ea1957c86964/build/lib.linux-x86_64-cpython-310', '-DBUILD_SHARED_LIBS=ON', '-DBUILD_PYTHON_STANDALONE=OFF', '-DKENLM_MAX_ORDER=6', '-DCMAKE_BUILD_TYPE=Release']' returned non-zero exit status 1.
      [end of output]

 note: This error originates from a subprocess, and is likely not a problem with pip.
 ERROR: Failed building wheel for camel-kenlm
 Failed to build camel-kenlm
 ERROR: Could not build wheels for camel-kenlm, which is required to install pyproject.toml-based projects
owo commented 1 year ago

Can you please specify which OS you are using?

AhsAlharthi commented 1 year ago

I'm on Ubuntu 22.04.3

phusroyal commented 1 year ago

I also encountered the same issue

owo commented 12 months ago

Can you try installing the build-essential package?

sudo apt install build-essential
Mahmoud-K-Ismail commented 7 months ago

I'm facing the same problem in MacOS 14.3.1 . It stops at

"Building wheels for collected packages: camel-kenlm Building wheel for camel-kenlm (pyproject.toml) ... error error: subprocess-exited-with-error

× Building wheel for camel-kenlm (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [830 lines of output]

and gives the following error:

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for camel-kenlm Failed to build camel-kenlm ERROR: Could not build wheels for camel-kenlm, which is required to install pyproject.toml-based projects

Is there a solution ?