Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Found this error message while import re2 #51

Open
noveneffendi opened this issue Jul 13, 2017 · 1 comment
Open

Found this error message while import re2 #51

noveneffendi opened this issue Jul 13, 2017 · 1 comment

Comments

@noveneffendi
Copy link

my device is centos7. can you help me to solve this problem?
ImportError: /usr/lib64/python2.7/site-packages/re2.so: undefined symbol: _ZNK3re23RE25MatchERKNS_11StringPieceEmmNS0_6AnchorEPS1_i

@leewz
Copy link

leewz commented Feb 4, 2018

I got a similar error:

ImportError: /usr/local/lib/python3.5/dist-packages/re2.cpython-35m-x86_64-linux-gnu.so: undefined symbol: _ZN3re23RE27ReplaceEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKS0_RKNS_11StringPieceE

I installed the latest GCC (7,2.0):

sudo apt-get install gcc-7 g++-7

Aliased g++:

alias g++=g++-7

Re-make'd re2 (the C++ library)

make clean
sudo make install
make testinstall

Reinstalled pyre2 (just in case)

sudo python setup.py install
sudo python3 setup.py install

And it worked. Almost. (see #34 and #49)

>>> import re2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "re2.pyx", line 1, in init re2 (src/re2.cpp:13681)
NameError: basestring

Python 3 removed the name basestring, so I needed to add it back in.

>>> __builtins__.basestring = str
>>> import re2
>>> #Success!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants