Skip to content
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

ImportError: cannot import name 'Bonito' from partially initialized module 'bonito' #46

Open
bmg-pcl opened this issue Feb 17, 2025 · 2 comments

Comments

@bmg-pcl
Copy link

bmg-pcl commented Feb 17, 2025

The new PyPI package fails with a circular import.

In 3.12.3 after pip install bonito-llm, running the demo on the Readme yields:

(312-venv) bgue@29J55349:~/devel$ python bonito.py
Traceback (most recent call last):
  File "/home/bgue/devel/bonito.py", line 1, in <module>
    from bonito import Bonito
  File "/home/bgue/devel/bonito.py", line 1, in <module>
    from bonito import Bonito
ImportError: cannot import name 'Bonito' from partially initialized module 'bonito' (most likely due to a circular import) (/home/bgue/devel/bonito.py)
(312-venv) bgue@29J55349:~/devel$ python
Python 3.12.3 (main, Jan 17 2025, 18:03:48) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import bonito
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/bgue/devel/bonito.py", line 1, in <module>
    from bonito import Bonito
ImportError: cannot import name 'Bonito' from partially initialized module 'bonito' (most likely due to a circular import) (/home/bgue/devel/bonito.py)
>>>
@nihalnayak
Copy link
Member

Hey! Thanks for sharing the issue. Could you rename the file to test_bonito.py instead of bonito.py? Does that solve your issue?

@bmg-pcl
Copy link
Author

bmg-pcl commented Feb 17, 2025

Thanks , I'll check and do some more diagnostics.

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