pyrocko / kite

InSAR unwrapped surface displacement processing for earthquake modelling.
https://pyrocko.org/kite/
GNU General Public License v3.0
79 stars 34 forks source link

circular import issue #113

Closed hvasbath closed 8 months ago

hvasbath commented 10 months ago

meysam on pyrocko support, installation channel

Hi, I wanted to update the Pyrocko and Kite, and I am facing this error. I wonder if anyone knows the reason for that? 
Traceback (most recent call last):
  File "/home/geodesy/anaconda3/envs/TEST_kite/bin/spool", line 5, in <module>
    from kite.spool.main import main
  File "/home/geodesy/anaconda3/envs/TEST_kite/lib/python3.9/site-packages/kite/init.py", line 4, in <module>
    from .covariance import Covariance  # noqa
  File "/home/geodesy/anaconda3/envs/TEST_kite/lib/python3.9/site-packages/kite/covariance.py", line 18, in <module>
    from kite import covariance_ext
ImportError: cannot import name 'covariance_ext' from partially initialized module 'kite' (most likely due to a circular import) (/home/geodesy/anaconda3/envs/TEST_kite/lib/python3.9/site-packages/kite/init.py)
hvasbath commented 10 months ago

Might be related: https://github.com/pyrocko/kite/pull/111

Uncleyyyyy commented 10 months ago

So if there is any solution now?

emolch commented 10 months ago

Have run into this several times with different setups. How exactly did you install kite? From source or using the pip package? Are you using the latest version? The latest commits on master try to resolve this issue.

hvasbath commented 10 months ago

I just did a fresh install ubuntu 20.04, python11 venv environment with the pip-meaning this does not include the latest installation patch and I have no issues. @Uncleyyyyy do you also have the issue? What are your system specs?

hvasbath commented 10 months ago

I confirm I can reproduce the issue when installing from source through pip on latest master. So it seems the latest patch caused the issue.

Suansuan0922 commented 10 months ago

I have the same error, is there any solution?

hvasbath commented 10 months ago

Hello @Suansuan0922 can you please provide your installation details?! Meysam (initial issue reporter) was meanwhile able to install it falling back to the latest released version (pip install kite) instead of the latest version on master (pip install . (in the source directory)).

hvasbath commented 10 months ago

The install instructions on the website need updating. They suggest to install from source. But the standard way should be to install latest stable release, i.e. with:

pip install kite
Uncleyyyyy commented 10 months ago

I just did a fresh install ubuntu 20.04, python11 venv environment with the pip-meaning this does not include the latest installation patch and I have no issues. @Uncleyyyyy do you also have the issue? What are your system specs?

Sorry to bother! I just tried to uninstall the environment and reinstall every module. And it works fine now! I think maybe there are some conflicts existing between the modules? However, there is no error now.

emolch commented 10 months ago

I added some compatibility fixes in the branch bugfix/compatibility, please check if this solves the issues.

auld-L commented 9 months ago

I install kite with anaconda,i can't find the setup.py ,what should i do?