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 Issue #23

Open
JLenzy opened this issue Feb 10, 2023 · 1 comment
Open

Circular Import Issue #23

JLenzy opened this issue Feb 10, 2023 · 1 comment

Comments

@JLenzy
Copy link

JLenzy commented Feb 10, 2023

I've tried running the default intro code block:

import miditoolkit
path_midi = miditoolkit.midi.utils.example_midi_file()
midi_obj = miditoolkit.midi.parser.MidiFile(path_midi)
print(midi_obj)

Which results in:

AttributeError: partially initialized module 'miditoolkit' has no attribute 'midi' (most likely due to a circular import)

I am running this on Python 3.9 with pip installation of miditoolkit. I verified that it is imported correctly and all the subfolders (i.e. midi, parser) are being referenced.

@akx
Copy link
Contributor

akx commented Nov 29, 2023

This ought to be fixed in recent versions (please see the updated example code from the README too).

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