我刚刚安装了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?发布于 2019-06-09 22:22:50
有时当路径中有空格时会出现错误--试着将你的文件夹"Projeto Python-Müsica“重命名为"Python-Musica”(同时去掉重音以确保unicode不是问题),看看它是否能解决问题。
发布于 2019-07-17 13:05:05
我遇到过这种情况,因为在jupyter上运行时不能使用Musscore3。尝试使用终端运行,它可以工作
https://stackoverflow.com/questions/56514068
复制相似问题