Making Abjad output a file

49 Views Asked by At

I'm trying the abjad library for python for the first time, but I'm not able to make it create neither lilypond nor pdf files. This is the error showing in the console every time I run it:

PS C:\Users\giuli\Coding\abjadExperiments>  & 'C:\Users\giuli\AppData\Local\Programs\Python\Python311\python.exe' 'c:\Users\giuli\.vscode\extensions\ms-python.python-2023.20.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher' '51354' '--' 'c:\Users\giuli\Coding\abjadExperiments\Abjad experiments.py' 
Traceback (most recent call last):
  File "c:\Users\giuli\Coding\abjadExperiments\Abjad experiments.py", line 3, in <module>
    abjad.show(n)
  File "C:\Users\giuli\AppData\Local\Programs\Python\Python311\Lib\site-packages\abjad\io.py", line 672, in show
    result = illustrator()
             ^^^^^^^^^^^^^
  File "C:\Users\giuli\AppData\Local\Programs\Python\Python311\Lib\site-packages\abjad\io.py", line 75, in __call__
    string = self.string or self.get_string()
                            ^^^^^^^^^^^^^^^^^
  File "C:\Users\giuli\AppData\Local\Programs\Python\Python311\Lib\site-packages\abjad\io.py", line 152, in get_string
    return lilypond_file._get_lilypond_format()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\giuli\AppData\Local\Programs\Python\Python311\Lib\site-packages\abjad\lilypondfile.py", line 474, in _get_lilypond_format
    string = configuration.get_lilypond_version_string()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\giuli\AppData\Local\Programs\Python\Python311\Lib\site-packages\abjad\configuration.py", line 388, in get_lilypond_version_string
    proc = subprocess.run(command, stdout=subprocess.PIPE)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\giuli\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\giuli\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\giuli\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 1538, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 2] The system cannot find the file specified

I've tried to go in abjad's configuration file (abjad.cfg) and I specified the lilypond path in this way:

# Lilypond executable path. Set to override dynamic lookup.
lilypond_path = C:\Program Files (x86)\LilyPond

But it doesn't seem to do anything really.

But I'm pretty convinced I'm mistaking something very banal that I'm not aware of. Can you suggest some solutions?

0

There are 0 best solutions below