ccht-ncsu / Kalpana

Visualization of ADCIRC Model Data in Vector Formats
GNU General Public License v3.0
26 stars 23 forks source link

Circular Import Error (downscaling.py) #123

Open msw17002 opened 2 months ago

msw17002 commented 2 months ago

Hello,

This problem occurs with the current source code (git clone 'this repository'). When I downloaded v0.0.22.tar.gz and reran the same script, the error didn't appear.

Both times, I used these commands to install Kalpana:

conda create --name kalpana python=3.11
conda activate Kalpana
pip install -e .

The error:

Traceback (most recent call last):
    from downscaling import meshRepLen2raster
  File "~/Kalpana/kalpana/downscaling.py", line 12, in <module>
    from kalpana.export import nc2shp, mesh2gdf, fort14togdf, readSubDomain # Changed
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "~/Kalpana/kalpana/kalpana.py", line 9, in <module>
    from downscaling import meshRepLen2raster, runStatic
ImportError: cannot import name 'meshRepLen2raster' from partially initialized module 'downscaling' (most likely due to a circular import) (~/Kalpana/kalpana/downscaling.py)
tomas19 commented 1 month ago

Hi sorry for taking so long to reply. I didn't get that error when I installed Kalpana; try changing line 9 in Kalpana.py from 'from downscaling ....' to 'from kalpana.downscaling import ....'. Please let me know if it works.

Tomás