Skip to content

File not found: /tmp/abletonosc-song-structure.json #48

@ltackett

Description

@ltackett

I’ve run into a few problems trying to run the example from the README, all based around a missing file which seems like it should be getting generated by the live set. I don’t know if AbletonOSC is responsible for this or not, but I’m getting nowhere trying to resolve this issue with no prior knowledge.

I installed pylive via pip3 install pylive. When I try to run the example script from the README, I get the following error:

> python3 test.py
Traceback (most recent call last):
  File//test.py", line 10, in <module>
    set = live.Set(scan=True)
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/live/classes/set.py", line 92, in __init__
    self.scan()
    ~~~~~~~~~^^
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/live/classes/set.py", line 135, in scan
    self._scan_via_file()
    ~~~~~~~~~~~~~~~~~~~^^
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/live/classes/set.py", line 289, in _scan_via_file
    with open(json_path, "r") as fd:
         ~~~~^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/abletonosc-song-structure.json'

If I manually create the missing file:

> touch /tmp/abletonosc-song-structure.json
> python3 test.py
Traceback (most recent call last):
  File//test.py", line 10, in <module>
    set = live.Set(scan=True)
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/live/classes/set.py", line 92, in __init__
    self.scan()
    ~~~~~~~~~^^
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/live/classes/set.py", line 135, in scan
    self._scan_via_file()
    ~~~~~~~~~~~~~~~~~~~^^
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/live/classes/set.py", line 290, in _scan_via_file
    data = json.load(fd)
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/json/__init__.py", line 293, in load
    return loads(fp.read(),
        cls=cls, object_hook=object_hook,
        parse_float=parse_float, parse_int=parse_int,
        parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ~~~~~~~~~~~~~~~~~~~~~~~^^^
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/json/decoder.py", line 345, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/json/decoder.py", line 363, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Populating the JSON file with an empty object ({}) gives me this error:

> python3 test.py
Traceback (most recent call last):
  File/../test.py", line 10, in <module>
    set = live.Set(scan=True)
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/live/classes/set.py", line 92, in __init__
    self.scan()
    ~~~~~~~~~^^
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/live/classes/set.py", line 135, in scan
    self._scan_via_file()
    ~~~~~~~~~~~~~~~~~~~^^
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/live/classes/set.py", line 291, in _scan_via_file
    tracks = data["tracks"]
             ~~~~^^^^^^^^^^
KeyError: 'tracks'

And adding an empty tracks array to the JSON file gives me this error:

{
  "tracks": []
}
> python3 test.py
Traceback (most recent call last):
  File/../test.py", line 16, in <module>
    track = set.tracks[0]
            ~~~~~~~~~~^^^
IndexError: list index out of range

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions