medpy icon indicating copy to clipboard operation
medpy copied to clipboard

test failed for graphcut.maxflow

Open hubutui opened this issue 6 years ago • 7 comments

Hi, I'm trying to package medpy for ArchLinux. After building medpy, I run PYTHONPATH="${PWD}/build/lib.linux-x86_64-3.7" nosetests -v, and here is the log.

==> Starting check()...
Failure: ModuleNotFoundError (No module named 'medpy.graphcut.maxflow') ... ERROR
Failure: ModuleNotFoundError (No module named 'medpy.graphcut.maxflow') ... ERROR

======================================================================
ERROR: Failure: ModuleNotFoundError (No module named 'medpy.graphcut.maxflow')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/nose/failure.py", line 39, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File "/usr/lib/python3.7/site-packages/nose/loader.py", line 417, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python3.7/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python3.7/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/usr/lib/python3.7/imp.py", line 244, in load_module
    return load_package(name, filename)
  File "/usr/lib/python3.7/imp.py", line 216, in load_package
    return _load(spec)
  File "<frozen importlib._bootstrap>", line 696, in _load
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/build/python-medpy/src/medpy-0.4.0/medpy/graphcut/__init__.py", line 200, in <module>
    from .maxflow import GraphDouble, GraphFloat, GraphInt # this always triggers an error in Eclipse, but is right
ModuleNotFoundError: No module named 'medpy.graphcut.maxflow'

======================================================================
ERROR: Failure: ModuleNotFoundError (No module named 'medpy.graphcut.maxflow')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/nose/failure.py", line 39, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File "/usr/lib/python3.7/site-packages/nose/loader.py", line 417, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python3.7/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python3.7/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/usr/lib/python3.7/imp.py", line 244, in load_module
    return load_package(name, filename)
  File "/usr/lib/python3.7/imp.py", line 216, in load_package
    return _load(spec)
  File "<frozen importlib._bootstrap>", line 696, in _load
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/build/python-medpy/src/medpy-0.4.0/tests/graphcut_/__init__.py", line 2, in <module>
    from .graph import TestGraph
  File "/build/python-medpy/src/medpy-0.4.0/tests/graphcut_/graph.py", line 19, in <module>
    from medpy.graphcut import GCGraph
  File "/build/python-medpy/src/medpy-0.4.0/medpy/graphcut/__init__.py", line 200, in <module>
    from .maxflow import GraphDouble, GraphFloat, GraphInt # this always triggers an error in Eclipse, but is right
ModuleNotFoundError: No module named 'medpy.graphcut.maxflow'

----------------------------------------------------------------------
Ran 2 tests in 0.382s

FAILED (errors=2)

Actually, if I skip the check, I could still import medpy.graphcut.maxflow without error. I'm not sure why the test failed.

hubutui avatar May 02 '19 08:05 hubutui

Thanks for pointing this out! It might have something to do with the relative import and conflicting names... I will look into this for the next release.

loli avatar May 06 '19 16:05 loli

Hello @loli ~

Has this issue been solved~ I encounter this error also, even after I install Boost.python and reinstall this package...

Thanks, Best, eric

EricKani avatar Mar 24 '20 19:03 EricKani

The graphcut plugin is notoriously tricky. If you don't need it, you can safely ignore this.

On Tue, 24 Mar 2020, 20:42 EricKani, [email protected] wrote:

Hello @loli https://github.com/loli ~

Has this issue been solved~ I encounter this error also, even after I install Boost.python and reinstall this package...

Thanks, Best, eric

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/loli/medpy/issues/89#issuecomment-603466868, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGLK7WS4B74K3UNUYMXZDLRJEELZANCNFSM4HJ4NN7Q .

loli avatar Mar 27 '20 16:03 loli

Hi~

Sorry I am not very good on English… Do you mean the integration of graphcut plugin is a hard problem for most people?But I really need this plugin…Do you have any other solutions or suggestions… Thank you very much!

Best, eric

On 03/28/2020 00:56, Oskar M. wrote:

The graphcut plugin is notoriously tricky. If you don't need it, you can safely ignore this.

On Tue, 24 Mar 2020, 20:42 EricKani, [email protected] wrote:

Hello @loli https://github.com/loli ~

Has this issue been solved~ I encounter this error also, even after I install Boost.python and reinstall this package...

Thanks, Best, eric

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/loli/medpy/issues/89#issuecomment-603466868, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGLK7WS4B74K3UNUYMXZDLRJEELZANCNFSM4HJ4NN7Q .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

EricKani avatar Mar 28 '20 01:03 EricKani

The follow link solve this issue. Install Boost.python and modify setup.py.

https://pengyizhang.github.io/2020/04/05/medpyinstall/

YunxinZhong avatar Apr 05 '20 02:04 YunxinZhong

The follow link solve this issue. Install Boost.python and modify setup.py.

https://pengyizhang.github.io/2020/04/05/medpyinstall/

Thanks for your reply~ But my server is Linux system. A little bit not suitable for my scene.

EricKani avatar Apr 05 '20 03:04 EricKani

Hello,

I also get the same problem on Fedora 32 using:

  • python 3.8 (from package manager)
  • python 3.6, 3.7 from anaconda

be it by installing it from source or via pypi. libboost-python is installed on my machine aswell.

#87 and #81 are related an relevant issues.

jjerphan avatar Jul 02 '20 13:07 jjerphan

Should now work for most ditros: see also http://loli.github.io/medpy/installation/graphcutsupport.html

And, in case it doesn't, can be installed pre-packed from conda-forge.

loli avatar Apr 03 '24 18:04 loli