Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Multiple ImportErrors and ModuleNotFoundErrors when running test suite. #493

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

Open
TheChymera opened this issue May 4, 2022 · 2 comments

Comments

@TheChymera
Copy link
Contributor

This is the whole build and test log: https://ppb.chymera.eu/5492b9.log

Most of the errors seem to be related to intvol:

ERROR: Failure: ImportError (cannot import name 'intvol' from partially initialized module 'nipy.algorithms.statistics' (most likely due to a circular import) (/var/tmp/portage/sci-libs/nipy-0.5.0/work/nipy-0.5.0/nipy/algorithms/statistics/__init__.py))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/nose/failure.py", line 39, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File "/usr/lib/python3.9/site-packages/nose/loader.py", line 418, in loadTestsFromName
    module = self.importer.importFromPath(
  File "/usr/lib/python3.9/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python3.9/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/usr/lib/python3.9/imp.py", line 234, in load_module
    return load_source(name, filename, file)
  File "/usr/lib/python3.9/imp.py", line 171, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 711, in _load
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/var/tmp/portage/sci-libs/nipy-0.5.0/work/nipy-0.5.0/nipy/labs/spatial_models/tests/test_parcel.py", line 7, in <module>
    from nipy.algorithms.graph.field import field_from_coo_matrix_and_data
  File "/var/tmp/portage/sci-libs/nipy-0.5.0/work/nipy-0.5.0/nipy/algorithms/__init__.py", line 8, in <module>
    from . import statistics
  File "/var/tmp/portage/sci-libs/nipy-0.5.0/work/nipy-0.5.0/nipy/algorithms/statistics/__init__.py", line 9, in <module>
    from . import intvol, rft, onesample, formula
ImportError: cannot import name 'intvol' from partially initialized module 'nipy.algorithms.statistics' (most likely due to a circular import) (/var/tmp/portage/sci-libs/nipy-0.5.0/work/nipy-0.5.0/nipy/algorithms/statistics/__init__.py)

But there are others as well. I assume it's an issue with accessing its own modules somehow?

@effigies
Copy link
Member

@TheChymera Does this persist with the latest master?

@effigies
Copy link
Member

@TheChymera I can reproduce this by running from within the source directory. Moving to the src/ layout would resolve this, but you can also cd to some other directory before running tests with --pyargs nipy.

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