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

import maxflow fails on python2.7.8 on conda env on Mac OS X #13

Closed
ProGM opened this issue Oct 31, 2014 · 2 comments
Closed

import maxflow fails on python2.7.8 on conda env on Mac OS X #13

ProGM opened this issue Oct 31, 2014 · 2 comments

Comments

@ProGM
Copy link
Contributor

ProGM commented Oct 31, 2014

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
Copy link
Owner

pmneila commented Oct 31, 2014

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
Copy link
Contributor Author

ProGM commented Oct 31, 2014

Oh, quite simple. It's working!
Thank you :)

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