pyre2
pyre2 copied to clipboard
Cannot import module on Python 3 (but compiling works fine)
I can't get this to work on python 3.4 (osx):
Traceback (most recent call last):
File "url.py", line 3, in <module>
import re2 as re
File "re2.pyx", line 1, in init re2 (src/re2.cpp:13681)
NameError: basestring
Same problem here with Linux Mint 17 and Python 3.4.3
@wbolster how can you solve this problem ?
the module isn't ported to python 3 at all, so you cannot easily work around this.
Have a look at my fork: https://github.com/andreasvc/pyre2 I made a lot of improvements, including Python 3 compatibility.
@andreasvc Thanks, you have done a great job!
Quick and very dirty fix:
>>> __builtins__.basestring = str
>>> import re2
>>>