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

Circular import with song.py and album.py #279

Closed
VslVictor7 opened this issue Dec 8, 2024 · 2 comments · Fixed by #280
Closed

Circular import with song.py and album.py #279

VslVictor7 opened this issue Dec 8, 2024 · 2 comments · Fixed by #280
Labels

Comments

@VslVictor7
Copy link

VslVictor7 commented Dec 8, 2024

Bug:
Seems like song.py and album.py are trying to import modules from each other, which is possibly why im getting this error.

"Traceback (most recent call last):
File "D:\Minecraft Servers\Status-Manager-Bot\bot\core\main.py", line 10, in
from commands import setup_commands
File "D:\Minecraft Servers\Status-Manager-Bot\bot\core\commands.py", line 8, in
from musica import lyrics_finder
File "D:\Minecraft Servers\Status-Manager-Bot\bot\core\musica\lyrics_finder.py", line 1, in
from lyricsgenius import Genius
File "D:\Minecraft Servers\Status-Manager-Bot\venv\Lib\site-packages\lyricsgenius_init_.py", line 8, in
from lyricsgenius.genius import Genius
File "D:\Minecraft Servers\Status-Manager-Bot\venv\Lib\site-packages\lyricsgenius\genius.py", line 16, in
from .types import Album, Artist, Song, Track
File "D:\Minecraft Servers\Status-Manager-Bot\venv\Lib\site-packages\lyricsgenius\types_init_.py", line 2, in
from .album import Album, Track
File "D:\Minecraft Servers\Status-Manager-Bot\venv\Lib\site-packages\lyricsgenius\types\album.py", line 4, in
from .song import Song
File "D:\Minecraft Servers\Status-Manager-Bot\venv\Lib\site-packages\lyricsgenius\types\song.py", line 8, in
from .album import Album
ImportError: cannot import name 'Album' from partially initialized module 'lyricsgenius.types.album' (most likely due to a circular import) (D:\Minecraft Servers\Status-Manager-Bot\venv\Lib\site-packages\lyricsgenius\types\album.py)"

Version info:

  • Latest master branch, commit: d4015f3
  • OS: Windows 11
  • Python 3.11.9
@allerter
Copy link
Contributor

allerter commented Dec 8, 2024

Thank you for this. I added a fix in #280, and we need to wait for the owner to merge it.
Until then you can install from the previous commit:

pip install git+https://github.com/johnwmillr/LyricsGenius.git@4671f043cea5535f7dc4affbd55803ae5a1ec6a4

@allerter allerter added the bug label Dec 8, 2024
@allerter allerter linked a pull request Dec 8, 2024 that will close this issue
@VslVictor7
Copy link
Author

Tysm for looking into this, commit ee6c7fb seems stable in my testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants