axiak / pyre2

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

import re2 in Python in Mac OS X #29

Closed RahulKulhari closed 9 years ago

RahulKulhari commented 9 years ago

import re2 Traceback (most recent call last): File "", line 1, in ImportError: dlopen(/Users/us/Anaconda/anaconda/lib/python2.7/site-packages/re2.so, 2): Symbol not found: __ZN3re23RE213GlobalReplaceEPSsRKS0_RKNS_11StringPieceE Referenced from: /Users/us/Anaconda/anaconda/lib/python2.7/site-packages/re2.so Expected in: dynamic lookup

Installation Procedure i followed:

first i install re2 using

brew install re2

then i did:

$ git clone git://github.com/axiak/pyre2.git $ cd pyre2.git $ sudo python setup.py install

I am getting this error when i am importing re2 in python Mac OS X.

How to solve this issue ?

Tafkas commented 9 years ago

I face the same issue.

kmike commented 9 years ago

It looks like conda/anaconda issue - they don't play well with python C extensions installed using setuptools/distutils.

Tafkas commented 9 years ago

In my case I am not using Anaconda but regular python installed by homebrew. re2 was also installed by homebrew.

kmike commented 9 years ago

Hmm, I've just tried the following, it worked:

brew upgrade re2
mkvirtualenv tst
pip install https://github.com/axiak/pyre2/archive/master.zip#egg=pyre2 
axiak commented 9 years ago

I can't reproduce this on OS X