`import maxflow` fails on python2.7.8 on conda env on Mac OS X
ProGM opened this issue · 2 comments
ProGM commented
After installing conda
I tried to install PyMaxflow in his local env:
$ python -V
Python 2.7.8 :: Continuum Analytics, Inc.
$ which python
/Users/progm/anaconda/bin/python
$ conda install cython
...
$ git clone https://github.com/pmneila/PyMaxflow
$ cd PyMaxflow
$ python setup.py install
...
ok
But when I run python and I try to import maxflow
I receive this error:
[GCC 4.2.1 (Apple Inc. build 5577)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://binstar.org
>>> import maxflow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/progm/anaconda/lib/python2.7/site-packages/maxflow/__init__.py", line 37, in <module>
import _maxflow
ImportError: dlopen(/Users/progm/anaconda/lib/python2.7/site-packages/maxflow/_maxflow.so, 2): Symbol not found: __ZNSs4_Rep20_S_empty_rep_storageE
Referenced from: /Users/progm/anaconda/lib/python2.7/site-packages/maxflow/_maxflow.so
Expected in: dynamic lookup
>>>
This is not happening if I use builtin Mac OS X python 2.7.6.
Any idea?
pmneila commented
Hi.
It looks like it is not linking to libstdc++. Try compiling with LDFLAGS=-lstdc++
:
$ rm -r build/
$ LDFLAGS=-lstdc++ python setup.py build
$ python setup.py install
Let me know if it works.
ProGM commented
Oh, quite simple. It's working!
Thank you :)