YatingMusic / miditoolkit

https://pypi.org/project/miditoolkit/
MIT License
237 stars 33 forks source link

Circular Import Issue #23

Open JLenzy opened 1 year ago

JLenzy commented 1 year ago

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 commented 11 months ago

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