KristoforMaynard/music-tag

ERRROR: partially initialized module `music_tag` has no attribute `load_file`

Closed this issue · 2 comments

I faced the issue when using your module.

The step procedure is following:

  1. Install music-tag
~/work/script/music_tag pip3 install music-tag --upgrade
Requirement already up-to-date: music-tag in /home/quyleanh/.local/lib/python3.8/site-packages (0.4.2)
Requirement already satisfied, skipping upgrade: mutagen in /usr/local/lib/python3.8/dist-packages/mutagen-1.45.1-py3.8.egg (from music-tag) (1.45.1)
  1. Run python script
~/work/script/music_tag python3 music_tag.py
Traceback (most recent call last):
  File "music_tag.py", line 1, in <module>
    import music_tag
  File "/home/quyleanh/work/script/music_tag/music_tag.py", line 4, in <module>
    f = music_tag.load_file("test.flac")
AttributeError: partially initialized module 'music_tag' has no attribute 'load_file' (most likely due to a circular import)

My music_tag.py content is following:

import music_tag

f = music_tag.load_file("test.flac")
print(f['title'])

Could you please take a look at this?

You named your script with the same name as the library... the script is importing itself.

Thank you very much. My bad 😆