Skip to content

Example.py not working with no running event loop #20

@mezza

Description

@mezza

Thanks for the example.py script, but I'm unable to get it to work. I've created a new virtualenv using Python 3.13.3 and pip install podpointclient works correctly.

When using the example.py script, it initially reports :

ModuleNotFoundError: No module named 'async_timeout'

So I installed that and ran the example script again, but now I get:

Traceback (most recent call last):
  File "~/Downloads/example.py", line 2, in <module>
    from podpointclient.client import PodPointClient
  File "~/.pyenv/versions/podpoint/lib/python3.13/site-packages/podpointclient/client.py", line 31, in <module>
    class PodPointClient:
    ...<370 lines>...
            return json
  File "~/.pyenv/versions/podpoint/lib/python3.13/site-packages/podpointclient/client.py", line 38, in PodPointClient
    session: aiohttp.ClientSession = aiohttp.ClientSession(),
                                     ~~~~~~~~~~~~~~~~~~~~~^^
  File "~/.pyenv/versions/podpoint/lib/python3.13/site-packages/aiohttp/client.py", line 310, in __init__
    loop = loop or asyncio.get_running_loop()
                   ~~~~~~~~~~~~~~~~~~~~~~~~^^
RuntimeError: no running event loop               

Any advice?

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