ANTsX / ANTsPy

A fast medical imaging analysis library in Python with algorithms for registration, segmentation, and more.
https://antspyx.readthedocs.io
Apache License 2.0
586 stars 161 forks source link

lib dependencies #627

Closed ntustison closed 1 month ago

ntustison commented 1 month ago

I'm trying to import ants with the new merge (thanks @ncullen93 ). I'm getting the following error on Macbook Pro (both M1 and M3 models):

Any advice?

Traceback (most recent call last):
  File "/Users/ntustison/.python_shell_startup.py", line 1, in <module>
    import ants
  File "/Users/ntustison/Pkg/ANTsPy/ants/__init__.py", line 4, in <module>
    from .core import *
  File "/Users/ntustison/Pkg/ANTsPy/ants/core/__init__.py", line 2, in <module>
    from .ants_image_io import (
  File "/Users/ntustison/Pkg/ANTsPy/ants/core/ants_image_io.py", line 28, in <module>
    from . import ants_image as iio
  File "/Users/ntustison/Pkg/ANTsPy/ants/core/ants_image.py", line 28, in <module>
    from .. import registration, segmentation, utils, viz
  File "/Users/ntustison/Pkg/ANTsPy/ants/registration/__init__.py", line 3, in <module>
    from .affine_initializer import affine_initializer
  File "/Users/ntustison/Pkg/ANTsPy/ants/registration/affine_initializer.py", line 7, in <module>
    from .. import utils
  File "/Users/ntustison/Pkg/ANTsPy/ants/utils/__init__.py", line 2, in <module>
    from .bias_correction import (n3_bias_field_correction, n3_bias_field_correction2, n4_bias_field_correction, abp_n4)
  File "/Users/ntustison/Pkg/ANTsPy/ants/utils/bias_correction.py", line 4, in <module>
    from . import process_args as pargs
  File "/Users/ntustison/Pkg/ANTsPy/ants/utils/process_args.py", line 14, in <module>
    from .. import lib
ImportError: cannot import name 'lib' from partially initialized module 'ants' (most likely due to a circular import) (/Users/ntustison/Pkg/ANTsPy/ants/__init__.py)
cookpa commented 1 month ago

Are you running python from the ANTsPy/ directory? That will cause this error

ntustison commented 1 month ago

Oh, duh. Awesome. Thanks @cookpa