The version released to PyPI is not Python 3 compatible; basestring
only exists in Python 2. This will not be the only problem, fixing a text-focused project to fit the Python 3 all-text-is-Unicode view is not trivial.
It appears the specific project is unmaintained; others have already reported the problem, and people have pointed to a different fork: https://github.com/andreasvc/pyre2.
You can install that project directly from GitHub:
pip install git+https://github.com/andreasvc/pyre2.git
Note that you'll need to install Cython first for that project to compile; unlike the other fork the generated C++ file (from the re2.pyx
file) is not checked in. Just run pip install Cython
.
You could also look at alternatives; perhaps the regex
module would fit your requirements as well. regex
is a drop-in replacement for re
with additional features, like vastly improved Unicode support.