Closed Daniel63656 closed 1 month ago
You need to provide more information since this is normally working:
(.venv) laurent@gromit doc % python3 -m pip install verovio
Collecting verovio
Using cached verovio-4.3.1-cp312-cp312-macosx_11_0_arm64.whl.metadata (9.0 kB)
Using cached verovio-4.3.1-cp312-cp312-macosx_11_0_arm64.whl (6.6 MB)
Installing collected packages: verovio
Successfully installed verovio-4.3.1
(.venv) laurent@gromit doc % python3
Python 3.12.6 (main, Sep 6 2024, 19:03:47) [Clang 15.0.0 (clang-1500.3.9.4)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import verovio
>>> tk = verovio.toolkit()
>>> print(tk.getOptions())
{'adjustPageHeight': False, 'adjustPageWidth': False, 'appXPathQuery': [], 'barLineSeparation': 0.8, 'barLineWidth': 0.3, 'beamFrenchStyle': False, 'beamMaxSlope': 10, 'beamMixedPreserve': False, 'beamMixedStemMin': 3.5, 'bottomMarginArtic': 0.75, 'bottomMarginHarm': 1.0, 'bottomMarginHeader': 2.0, 'bottomMarginOctave': 1.0, 'bracketThickness': 1.0, 'breaks': 'auto', 'breaksNoWidow': False, 'breaksSmartSb': 0.66, 'choiceXPathQuery': [], 'condense': 'auto', 'condenseFirstPage': False, 'condenseNotLastSystem': False, 'condenseTempoPages': False, 'dashedBarLineDashLength': 1.14, 'dashedBarLineGapLength': 1.14, 'defaultBottomMargin': 0.5, 'defaultLeftMargin': 0.0, 'defaultRightMargin': 0.0, 'defaultTopMargin': 0.5, 'dynamDist': 1.0, 'dynamSingleGlyphs': False, 'engravingDefaults': {}, 'evenNoteSpacing': False, 'expand': '', 'extenderLineMinSpace': 1.5, 'fingeringScale': 0.75, 'font': 'Leipzig', 'fontAddCustom': [], 'fontFallback': 'Leipzig', 'fontLoadAll': False, 'footer': 'auto', 'graceFactor': 0.75, 'graceRhythmAlign': False, 'graceRightAlign': False, 'hairpinSize': 3.0, 'hairpinThickness': 0.2, 'handwrittenFont': ['Petaluma'], 'harmDist': 1.0, 'header': 'auto', 'humType': False, 'incip': False, 'justificationBraceGroup': 1.0, 'justificationBracketGroup': 1.0, 'justificationMaxVertical': 0.3, 'justificationStaff': 1.0, 'justificationSystem': 1.0, 'justifyVertically': False, 'landscape': False, 'ledgerLineExtension': 0.54, 'ledgerLineThickness': 0.25, 'leftMarginAccid': 1.0, 'leftMarginBarLine': 0.0, 'leftMarginBeatRpt': 2.0, 'leftMarginChord': 1.0, 'leftMarginClef': 1.0, 'leftMarginKeySig': 1.0, 'leftMarginLeftBarLine': 1.0, 'leftMarginMRest': 0.0, 'leftMarginMRpt2': 0.0, 'leftMarginMensur': 1.0, 'leftMarginMeterSig': 1.0, 'leftMarginMultiRest': 0.0, 'leftMarginMultiRpt': 0.0, 'leftMarginNote': 1.0, 'leftMarginRest': 1.0, 'leftMarginRightBarLine': 1.0, 'leftMarginTabDurSym': 1.0, 'ligatureAsBracket': False, 'loadSelectedMdivOnly': False, 'lyricElision': 'regular', 'lyricLineThickness': 0.25, 'lyricNoStartHyphen': False, 'lyricSize': 4.5, 'lyricTopMinMargin': 2.0, 'lyricVerseCollapse': False, 'lyricWordSpace': 1.2, 'mdivAll': False, 'mdivXPathQuery': '', 'measureMinWidth': 15, 'mensuralToMeasure': False, 'midiNoCue': False, 'midiTempoAdjustment': 1.0, 'minLastJustification': 0.8, 'mmOutput': False, 'mnumInterval': 0, 'moveScoreDefinitionToStaff': False, 'multiRestStyle': 'auto', 'multiRestThickness': 2.0, 'neumeAsNote': False, 'noJustification': False, 'octaveAlternativeSymbols': False, 'octaveLineThickness': 0.2, 'octaveNoSpanningParentheses': False, 'openControlEvents': False, 'outputFormatRaw': False, 'outputIndent': 3, 'outputIndentTab': False, 'outputSmuflXmlEntities': False, 'pageHeight': 2970, 'pageMarginBottom': 50, 'pageMarginLeft': 50, 'pageMarginRight': 50, 'pageMarginTop': 50, 'pageWidth': 2100, 'pedalLineThickness': 0.2, 'pedalStyle': 'auto', 'preserveAnalyticalMarkup': False, 'removeIds': False, 'repeatBarLineDotSeparation': 0.36, 'repeatEndingLineThickness': 0.15, 'rightMarginAccid': 0.5, 'rightMarginBarLine': 0.0, 'rightMarginBeatRpt': 0.0, 'rightMarginChord': 0.0, 'rightMarginClef': 1.0, 'rightMarginKeySig': 1.0, 'rightMarginLeftBarLine': 1.0, 'rightMarginMRest': 0.0, 'rightMarginMRpt2': 0.0, 'rightMarginMensur': 1.0, 'rightMarginMeterSig': 1.0, 'rightMarginMultiRest': 0.0, 'rightMarginMultiRpt': 0.0, 'rightMarginNote': 0.0, 'rightMarginRest': 0.0, 'rightMarginRightBarLine': 0.0, 'rightMarginTabDurSym': 0.0, 'scale': 100, 'scaleToPageSize': False, 'setLocale': False, 'showRuntime': False, 'shrinkToFit': False, 'slurCurveFactor': 1.0, 'slurEndpointFlexibility': 0.0, 'slurEndpointThickness': 0.1, 'slurMargin': 1.0, 'slurMaxSlope': 60, 'slurMidpointThickness': 0.6, 'slurSymmetry': 0.0, 'smuflTextFont': 'embedded', 'spacingBraceGroup': 12, 'spacingBracketGroup': 12, 'spacingDurDetection': False, 'spacingLinear': 0.25, 'spacingNonLinear': 0.6, 'spacingStaff': 12, 'spacingSystem': 4, 'staccatoCenter': False, 'staffLineWidth': 0.15, 'stemWidth': 0.2, 'subBracketThickness': 0.2, 'substXPathQuery': [], 'svgAdditionalAttribute': [], 'svgBoundingBoxes': False, 'svgCss': '', 'svgFormatRaw': False, 'svgHtml5': False, 'svgRemoveXlink': False, 'svgViewBox': False, 'systemDivider': 'auto', 'systemMaxPerPage': 0, 'textEnclosureThickness': 0.2, 'thickBarlineThickness': 1.0, 'tieEndpointThickness': 0.1, 'tieMidpointThickness': 0.5, 'tieMinLength': 2.0, 'topMarginArtic': 0.75, 'topMarginHarm': 1.0, 'topMarginPgFooter': 2.0, 'transpose': '', 'transposeMdiv': {}, 'transposeSelectedOnly': False, 'transposeToSoundingPitch': False, 'tupletAngledOnBeams': False, 'tupletBracketThickness': 0.2, 'tupletNumHead': False, 'unit': 9.0, 'useBraceGlyph': False, 'useFacsimile': False, 'usePgFooterForAll': False, 'usePgHeaderForAll': False, 'xmlIdChecksum': False, 'xmlIdSeed': 0}
>>>
Hm maybe this is somehow related to #3809 then?
I am running this in VScode in a jupyter notebook (although running in .py also fails. No print, no error or stack trace, just program does not execute after tk.getOptions()).
verovio 4.3.1 pypi_0 pypi
Maybe the jupyter log helps
Visual Studio Code (1.93.1, undefined, desktop)
Jupyter Extension Version: 2024.8.1.
Python Extension Version: 2024.14.1.
Pylance Extension Version: 2024.9.2.
Platform: win32 (x64).
Temp Storage folder ~\AppData\Roaming\Code\User\globalStorage\ms-toolsai.jupyter\version-2024.8.1
Workspace folder ~\OMR, Home = c:\Users\Daniel
09:54:47.569 [info] Starting Kernel (Python Path: ~\anaconda3\envs\musicml\python.exe, Conda, 3.11.5) for '~\OMR\z.ipynb' (disableUI=true)
09:54:52.397 [info] Process Execution: ~\anaconda3\envs\musicml\python.exe -c "import ipykernel; print(ipykernel.__version__); print("5dc3a68c-e34e-4080-9c3e-2a532b2ccb4d"); print(ipykernel.__file__)"
09:54:52.405 [info] Process Execution: ~\anaconda3\envs\musicml\python.exe c:\Users\~\.vscode\extensions\ms-toolsai.jupyter-2024.8.1-win32-x64\pythonFiles\vscode_datascience_helpers\kernel_interrupt_daemon.py --ppid 12176
> cwd: ~\.vscode\extensions\ms-toolsai.jupyter-2024.8.1-win32-x64\pythonFiles\vscode_datascience_helpers
09:54:52.414 [info] Process Execution: ~\anaconda3\envs\musicml\python.exe -m pip list
09:54:52.581 [info] Process Execution: ~\anaconda3\envs\musicml\python.exe -m ipykernel_launcher --f=c:\Users\~\AppData\Roaming\jupyter\runtime\kernel-v35971740f75bcd342d1d179448dcc0ea1aa84525f.json
> cwd: ~\OMR
09:54:54.320 [info] Kernel successfully started
09:55:08.388 [info] Process Execution: ~\anaconda3\envs\musicml\python.exe c:\Users\~\.vscode\extensions\ms-toolsai.jupyter-2024.8.1-win32-x64\pythonFiles\printJupyterDataDir.py
10:08:13.507 [error] Disposing session as kernel process died ExitCode: 3221225477, Reason: [Warning] MusicXML import: Dangling ending tag skipped
[Error] Parameter value 590 for 'spacingSystem' out of bounds; default is 4, minimum 0, and maximum 48
[Warning] MusicXML import: Dangling ending tag skipped
[Error] Parameter value 590 for 'spacingSystem' out of bounds; default is 4, minimum 0, and maximum 48
[Warning] MusicXML import: Dangling ending tag skipped
[Warning] MusicXML import: Dangling ending tag skipped
[Warning] MusicXML import: Dangling ending tag skipped
[Error] Parameter value 590 for 'spacingSystem' out of bounds; default is 4, minimum 0, and maximum 48
[Warning] MusicXML import: Dangling ending tag skipped
[Error] Parameter value 590 for 'spacingSystem' out of bounds; default is 4, minimum 0, and maximum 48
Your MusicXML file is not properly coded. Edit the file to remove the 590 in spacingsystem and see if that fixes it.
obviously Verovio shouldn’t crash though.
Please share the input file for debugging.
I don't see any "spacingsysstem" entry. Unfortunately Github doesn't allow to attach the musicxml file directly
The 590 is an option your are setting. Maybe you want to double check you installation and the options you are passing?
You file renders properly for me with Python version 4.3.1. - with some [Warning] MusicXML import: Dangling ending tag skipped
, though.
Something looks wrong in your installation and / or options. Please double check or narrow it down.
Yes I can also render the file. This issue is unrelated to the file. It happens just when printing options as described in the original post. I don't set any options manually.
import verovio
tk = verovio.toolkit()
print(tk.getOptions())
Does it work with another file? And does it work if you remove the bad dangling ending tags? Can you share the notebook?
If this is just this file you need to narrow it down to which part of it crashes Verovio. As long as nobody else can reproduce your error it will be difficult to help you, or if needed to fix Verovio.
How can it crash on the MusicXML file since the lines you show are not loading it??
I don't know, the error is produced just by the three lines I provided. No musicxml is loaded. The first log I posted included also loading musicxml but the error happens independently from any file (without loading anything)
No musicxml is loaded but it is shown in the log?? Sounds like magic to me...
The log specifically for the 3 lines of code report an undefined exception.
09:19:00.910 [error] Error in execution (get message for cell) Error: The kernel 'musicml (Python 3.11.5)' died. Click [here](https://aka.ms/vscodeJupyterKernelCrash) for more info. View Jupyter [log](command:jupyter.viewOutput) for further details.
> Kernel Id = .jvsc74a57bd0bdb182ff9b7792a4228eb77fcd2cfc338c387f018ed9552ebce02b4ca194ac53.c:\Users\~\anaconda3\envs\musicml\python.exe.c:\Users\~\anaconda3\envs\musicml\python.exe.-m#ipykernel_launcher
> Interpreter Id = ~\anaconda3\envs\musicml\python.exe
> at Function.verifyKernelState (c:\Users\~\.vscode\extensions\ms-toolsai.jupyter-2024.8.1-win32-x64\dist\extension.node.js:304:79709)
> originalException = undefined
VSCode
Version: 1.94.1
Commit: e10f2369d0d9614a452462f2e01cdc4aa9486296
Date: 2024-10-05T05:44:32.189Z
Electron: 30.5.1
ElectronBuildId: 10262041
Chromium: 124.0.6367.243
Node.js: 20.16.0
V8: 12.4.254.20-electron.0
OS: Darwin arm64 24.0.0
Python 3.10.5 Verovio 4.3.1
Python 3.11.6
It looks like Jupyter is the thing that is crashing. It may be some interaction with Verovio and Jupyter, but it’s not being directly run in vscode (I think?)
Also it’s running through Anaconda, which is another layer of difference than “bare” Python
Yes, we clearly do not have enough information to do anything about this.
What can I provide then? For me it doesn't work in notebook (run in VsCode) and not as script
You could try running your notebook somewhere else, just to see.
It seems to work OK in Google Colab (hosted Jupyter):
If you do the exact same thing on your system, do you get an error?
Something must be screwed up in your installation. Which operating system are you working on? Which version of Python? How do you install it? What is your script? Just saying that it crashes in not helpful.
Just tried on anaconda.cloud and it works there too (anaconda-2024.02-py310)
Reopen the issue if you have some information under which circumstances it crashes, these being not just your machine.
tk.getVersion()
>>>'4.3.1[undefined]'
maybe it has something to do with this undefined? For you it lists something.
I just install with pip install verovio
in a python env.
This means that either you modified Verovio locally, or that the wheel had to be built because the combination of OS, architecture and Python version is not available in PyPi. Whichever, the result of your build process is corrupted. Such crashes happen typically when the program running is dynamically linked to a version of the library that do not correspond to the version expected.
It is not impossible that there is a problem in Verovio even though this looks more like something messed up in your set up. If you think there is a problem in Verovio you need to come up with a detailed step-by-step way for somebody else to reproduce the error. That needs to include telling which OS your work on and which version of Python you use.
Yes I suspect there is something wrong with the build.
I am on Windows 10, Version 22H2 (Build 19045.4894)
I installed verovio in a python 3.11.5 environment (using conda) with $ pip install verovio
I never downloaded verovio locally and modified it. I also tried purging the cache and reinstalling it
$ pip cache dir
$ pip cache purge
$ pip install verovio
The error persists. This must be something with the distribution of verovio for this OS/python version.
Edit: I also tried in a new env and it works there (despite printing the same strange version of '4.3.1[undefined]'. Can another package "interfere" with verovio? Maybe because this is now 3.11.10?
$ conda create -n verovio_test python=3.11
$ conda activate verovio_test
$ pip install verovio
Don't know what caused the error but it works now at least đź‘Ť
Using python, accessing or printing options dict crashes the kernel for notebooks and prints nothing in scripts.