Skip to content

Python xviz example not working for python versions >=3.9 #739

@PabloVD-Aerosim

Description

@PabloVD-Aerosim

I'm running the serve_scenarios.py script from the circle example for the python xviz library. It works fine for python versions <=3.8. However, for higher python version, it does not work, it raises an error. Here is the output error using a conda environment with python 3.12:

/home/xviz/python/examples/serve_scenarios.py:52: DeprecationWarning: There is no current event loop
  loop = asyncio.get_event_loop()
Traceback (most recent call last):
  File "/home/xviz/python/examples/serve_scenarios.py", line 53, in <module>
    loop.run_until_complete(server.serve())
                            ^^^^^^^^^^^^^^
  File "/home/tda/miniconda3/envs/py312/lib/python3.12/site-packages/xviz_avs/server/server.py", line 59, in serve
    return websockets.serve(**self._serve_options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: serve.__init__() missing 1 required positional argument: 'handler'

Any clue on why is that? May I modify something in the serve_scenarios.py script to make it work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions