我刚刚安装了music21,想要开始使用它。我已经安装了Musescore3,但是我无法让show()函数正常工作。
我尝试更改路径,按照我在网上找到的一些说明进行操作,但是没有成功。
from music21 import *
us = environment.UserSettings()
us['musicxmlPath'] = 'D:\\Program Files\\MuseScore 3\\bin\\Musescore3.exe'
us['musicxmlPath'] = 'D:\\Program Files\\MuseScore 3\\bin\\Musescore3.exe'
我试图做一个简单的show()
from music21 import *
f = note.Note('F5')
f.show()
以下是我遇到的错误:
Python 3.7.3 (default, Mar 27 2019, 17:13:21) [MSC v.1915 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.
IPython 7.4.0 -- An enhanced Interactive Python.
runfile('D:/Users/Pedro/Pedro/Projeto Python-Música/music21test.py', wdir='D:/Users/Pedro/Pedro/Projeto Python-Música')
D:\Program Files\MuseScore 3\bin\Musescore3.exe
Traceback (most recent call last):
File "<ipython-input-1-19e1672511d4>", line 1, in <module>
runfile('D:/Users/Pedro/Pedro/Projeto Python-Música/music21test.py', wdir='D:/Users/Pedro/Pedro/Projeto Python-Música')
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 786, in runfile
execfile(filename, namespace)
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "D:/Users/Pedro/Pedro/Projeto Python-Música/music21test.py", line 14, in <module>
f.show()
File "C:\ProgramData\Anaconda3\lib\site-packages\music21\base.py", line 2580, in show
**keywords)
File "C:\ProgramData\Anaconda3\lib\site-packages\music21\converter\subConverters.py", line 360, in show
subformats=helperSubformats, **keywords)
File "C:\ProgramData\Anaconda3\lib\site-packages\music21\converter\subConverters.py", line 938, in write
fp = self.runThroughMusescore(fp, subformats, **keywords)
File "C:\ProgramData\Anaconda3\lib\site-packages\music21\converter\subConverters.py", line 895, in runThroughMusescore
return self.findPNGfpFromXMLfp(fpOut)
File "C:\ProgramData\Anaconda3\lib\site-packages\music21\converter\subConverters.py", line 807, in findPNGfpFromXMLfp
"png file of xml not found. Or file >999 pages?")
SubConverterFileIOException: png file of xml not found. Or file >999 pages?