Problem with MusicXML Reader Path

117 views
Skip to first unread message

Pia S.

unread,
Jan 16, 2024, 2:43:31 PMJan 16
to music21
Hey music21-community,

I am trying to use the music.show() command in music21. I've installed MuseScore and configured the path in music21. I also tried to manually set the MusicXML Reader with environment.set().

Still when I am trying to do .show() with my piece I always get the same error message:

"SubConverterException: Cannot find a path to the 'mscore' file at D:\repos\analysis\C:\Program Files\MuseScore 3\bin\MuseScore3.exe -- download MuseScore"

The path listed in the error obvisously doesn't exist, it has nothing to do with my file and I don't even have MuseScore3. It's weird.

My first guess was there may be a problem with the different drives (C and D). I have my MuseScore4 installation on a different drive than my code (a Jupyter Notebook in my case). Not sure about that.

But still the MuseScore3 part doesn't make sense, I don't even have MuseScore3 on my machine now. It looks like the xml-reader path from my old laptop.

The second weird thing is I tried .show() with a fresh Jupyter notebook on my C drive. And it still showed the same error, including the mixed up drive C and D path.

Restarting the kernel also doesn't work.

Any ideas how I can solve this problem?

Thanks in advance!

Pia
Screenshot 2024-01-16 204058.png

Screenshot 2024-01-16 203900.png

Wayne McDermott

unread,
Jan 27, 2024, 6:23:05 PMJan 27
to music21
I was having exactly this problem. I eventually got it fixed by creating a new python file in Visual Studio code that consisted of 

import
music21 music21.configure.run()

and running it. It took a little while but eventually found my Musescore 4 executable. I had originally tried running it by running python in powershell but that didn't work.

Hope this helps.

Mauro

unread,
Mar 31, 2024, 2:27:13 PMMar 31
to music21
import os
import subprocess

museScorePath = "/Applications/MuseScore 4.app/Contents/MacOS/mscore"
os.environ['MUSICXMLPATH'] = museScorePath

# Crea un oggetto nota
n = note.Note("D#3")
n.duration.type = 'half'

s = stream.Stream([n])
s.write('xml', fp='output.xml')
subprocess.Popen([museScorePath, "output.xml"])

Jingxin Xu

unread,
Apr 23, 2024, 2:08:10 AMApr 23
to music21
I don't know if this might help https://web.mit.edu/music21/doc/usersGuide/usersGuide_24_environment.html

basically, just run the following once
from music21 import *
us = environment.UserSettings()
us.create() # run if not already existing.
us['musicxmlPath'] = # your path

Reply all
Reply to author
Forward
0 new messages