pmneila / PyMaxflow

Python library for creating flow networks and computing the maxflow/mincut (aka graph-cuts for Python)

Home Page:http://pmneila.github.io/PyMaxflow/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

regarding the ImportError: cannot import name '_maxflow' from 'maxflow'

wenouyang opened this issue · comments

Hello, I have successfully installed the package using pip. However, when I try to test the program, I got the following error message. I think it might be related to the _maxflow.pyx but I do not know the reason.

Traceback (most recent call last):
  File "test_maxflow.py", line 6, in <module>
    import maxflow
  File "C:\Users\Desktop\Experiments\PyMaxflow-master\maxflow\__init__.py", line 36, in <module>
    from . import _maxflow
ImportError: cannot import name '_maxflow' from 'maxflow' (C:\Users\Desktop\Experiments\PyMaxflow-master\maxflow\__init__.py)
 

I think the source files are causing this error. Since you've already installed PyMaxflow via pip, you don't have to keep the source files. Just move the test_maxflow.py script and the examples folder to a separate location and run.

Installing from pip now will install a pre-compiled binary wheel for most platforms and Python versions. This problem should not happen anymore.

Best