andreasvc / pyre2

Python wrapper for RE2
BSD 3-Clause "New" or "Revised" License
99 stars 33 forks source link

issue installing on python 3.11 #38

Closed thebotsmith closed 1 year ago

thebotsmith commented 1 year ago
    778 | #include "re2/stringpiece.h"
        |          ^~~~~~~~~~~~~~~~~~~
  compilation terminated.
  ninja: build stopped: subcommand failed.
  Traceback (most recent call last):
    File "/home/admin/anaconda3/envs/py3.11/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 351, in <module>
      main()
    File "/home/admin/anaconda3/envs/py3.11/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 333, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/admin/anaconda3/envs/py3.11/lib/python3.11/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 249, in build_wheel
      return _build_backend().build_wheel(wheel_directory, config_settings,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 413, in build_wheel
      return self._build_with_temp_dir(['bdist_wheel'], '.whl',
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 398, in _build_with_temp_dir
      self.run_setup()
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 335, in run_setup
      exec(code, locals())
    File "<string>", line 116, in <module>
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/__init__.py", line 87, in setup
      return distutils.core.setup(**attrs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
      return run_commands(dist)
             ^^^^^^^^^^^^^^^^^^
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
      dist.run_commands()
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
      self.run_command(cmd)
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 1208, in run_command
      super().run_command(command)
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/wheel/bdist_wheel.py", line 325, in run
      self.run_command("build")
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 1208, in run_command
      super().run_command(command)
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build.py", line 132, in run
      self.run_command(cmd_name)
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
      self.distribution.run_command(command)
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/dist.py", line 1208, in run_command
      super().run_command(command)
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
      cmd_obj.run()
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/command/build_ext.py", line 84, in run
      _build_ext.run(self)
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run
      _build_ext.build_ext.run(self)
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 346, in run
      self.build_extensions()
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/Cython/Distutils/old_build_ext.py", line 195, in build_extensions
      _build_ext.build_ext.build_extensions(self)
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 468, in build_extensions
      self._build_extensions_serial()
    File "/tmp/pip-build-env-a0syq_4k/overlay/lib/python3.11/site-packages/setuptools/_distutils/command/build_ext.py", line 494, in _build_extensions_serial
      self.build_extension(ext)
    File "<string>", line 111, in build_extension
    File "/home/admin/anaconda3/envs/py3.11/lib/python3.11/subprocess.py", line 413, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--verbose']' 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 pyre2 Building wheel for lxml (setup.py) ... error error: subprocess-exited-with-error

andreasvc commented 1 year ago

Thanks for reporting. Not sure when I have time to look into this. In the meantime, I'd suggest compiling from source as explained in the README.

sarnold commented 1 year ago

That ^^ looks like you're building from source but did not install the re2 library first; this is required to build from the src tree => eg, brew install -s re2 pybind11 or apt-get install pybind11-dev libre2-dev.

If you were not intending to install from source. then use pip in a virtual env and see if you can install the platform wheel:


(.venv) $ pip install --no-cache pyre2
Collecting pyre2
  Downloading pyre2-0.3.6-cp39-cp39-manylinux2010_x86_64.whl (909 kB)
     |████████████████████████████████| 909 kB 407 kB/s 
Installing collected packages: pyre2
Successfully installed pyre2-0.3.6
thebotsmith commented 1 year ago

that worked - thank you