我运行这组非常简单的命令来显示一些乐谱:
import music21
music21.environment.set("musescoreDirectPNGPath", "/snap/bin/musescore.mscore")
bwv295 = music21.corpus.parse('bach/bwv295')
bwv295.show()我得到了错误:SubConverterFileIOException: No png file for /tmp/music21/tmpwh3jnppk.png (such as /tmp/music21/tmpwh3jnppk-1.png) was found. The conversion to png failed
我已经确保安装了libpng。我还检查了jupyter的调试,它说了几句话:
cannot load canberra-gtk-module (I sudo apt-get installed libcanberra-gtk-module)unable to load printer plugin "qtubuntu-print"File "/tmp/music21/tmpwh3jnppk.xml" not found.

但是,我的临时目录中肯定包含了这个包含填充信息的文件。
有什么想法吗?
发布于 2021-01-03 06:15:19
这里的解决方案是musescore没有正确安装。我安装了独立应用程序,并通过snap安装了它。
最后,您应该通过命令行安装它,然后我的命令序列就可以工作了。
sudo add-apt-repository ppa:mscore-ubuntu/mscore3-stable
sudo apt-get update
sudo apt install musescore3https://stackoverflow.com/questions/65545641
复制相似问题