llSourcell/Music_Generator_Demo

module 'midi' has no attribute 'Pattern'

Opened this issue · 2 comments

Traceback (most recent call last):
File "H:/Python Project/venv1/practice/tensorflow-music-generator-master/rbm_chords.py", line 148, in
midi_manipulation.noteStateMatrixToMidi(S, "out/generated_chord_{}".format(i))
File "H:\Python Project\venv1\practice\tensorflow-music-generator-master\midi_manipulation.py", line 77, in noteStateMatrixToMidi
pattern = midi.Pattern()
AttributeError: module 'midi' has no attribute 'Pattern'

Dose anybody know how to solve the problem?

@crown135 - This works for me ( Using Anaconda).

1.- install git:
conda install -c anaconda git

2.- install "module midi" from new repository:
pip install --upgrade git+https:// github.com/louisabraham/python3-midi

Collecting git+https://github.com/louisabraham/python3-midi
Cloning https://github.com/louisabraham/python3-midi to /tmp/pip-req-build-33rbbapt
Running command git clone -q https://github.com/louisabraham/python3-midi /tmp/pip-req-build-33rbbapt
Building wheels for collected packages: midi
Building wheel for midi (setup.py) ... error
ERROR: Failed building wheel for midi
Running setup.py clean for midi
Failed to build midi
Installing collected packages: midi
Running setup.py install for midi ... error
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-33rbbapt/setup.py'"'"'; file='"'"'/tmp/pip-req-build-33rbbapt/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-6y0u3f9v/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.

Doing pip install --upgrade git+https:// github.com/louisabraham/python3-midi throws the above error. Does anyone know how to solve this?