2017-05-30 113 views
0

最近我一直在用tensorflow嘗試機器學習。 This tutorial,有我卡住,因爲我不斷收到錯誤:AttributeError: module 'midi' has no attribute 'Pattern'有誰知道如何解決這個錯誤?我試過安裝py-midi(pip),python-midi(github)和midi模塊(pip)。但是,midi模塊從未正確安裝(「找不到滿足要求midi的版本」)。我使用python 3.5Python'midi'沒有屬性'Pattern'

我的代碼:
import midi pattern = midi.Pattern() track = midi.Track() pattern.append(track)

-Thanks提前!

+2

您能否提供一個[最小,可驗證和完整的示例](http://stackoverflow.com/help/mcve)?我不認爲很多人會觀看整個視頻來嘗試重現您的錯誤。 – blacksite

+0

剛剛編輯,添加了我的代碼的基本部分。 – LordColus

+0

你使用PIP安裝了MIDI嗎?哪個模塊? pip安裝midi? – RvdK

回答

0

通過直接從git安裝模塊修復了此錯誤:pip install git+https://github.com/vishnubob/[email protected]/python3this github頁面找到此命令。