Unable to install google-re2 on macos 14.1.1

319 views Asked by At

I want to install Apache Airflow and in the installation process, it needs google-re2. The error is:

  Building wheel for google-re2 (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [149 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.macosx-10.9-x86_64-cpython-311
      copying re2.py -> build/lib.macosx-10.9-x86_64-cpython-311
      running build_ext
      building '_re2' extension
      creating build/temp.macosx-10.9-x86_64-cpython-311
      x86_64-apple-darwin13.4.0-clang -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /Users/afshin/anaconda3/include -fPIC -O2 -isystem /Users/afshin/anaconda3/include -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/afshin/anaconda3/include -D_FORTIFY_SOURCE=2 -isystem /Users/afshin/anaconda3/include -I/Users/afshin/anaconda3/lib/python3.11/site-packages/pybind11/include -I/Users/afshin/anaconda3/include/python3.11 -c _re2.cc -o build/temp.macosx-10.9-x86_64-cpython-311/_re2.o -fvisibility=hidden
      _re2.cc:125:19: error: no viable conversion from 'absl::string_view' to 'const re2::StringPiece'
        if (!self.Match(text, pos, endpos, anchor, groups.data(), groups.size())) {
                        ^~~~
     ...
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for google-re2
  Running setup.py clean for google-re2

I checked multiple solutions but no one worked. I have Python 3.11.5.

1

There are 1 answers

0
p13rr0m On

There is currently an open issue for the re2 library on MacOS 14.

brew install re2 abseil
CFLAGS='-std=c++17' pip install google-re2