Skip to content

Concurrent Query Example fails with ImportError #80

@abmusse

Description

@abmusse

🐛 Describe the bug

I tested the 3. Using the Pool object to run queries “concurrently” example and ran into an import error.

https://mapepire-ibmi.github.io/guides/usage/python/

Not too sure whats causing the issue but thought I should report the issue.

OS: Fedora 42
Python: 3.13
mapepire-python: 0.2.0

import asyncio
from mapepire_python.pool.pool_client import Pool, PoolOptions

async def main():
    async with Pool(
        options=PoolOptions(
            creds="./mapepire.ini",
            opts=None,
            max_size=5,
            starting_size=3
        )
    ) as pool:
      job_names = []
      resultsA = await asyncio.gather(
          pool.execute('values (job_name)'),
          pool.execute('values (job_name)'),
          pool.execute('values (job_name)')
      )
      job_names = [res['data'][0]['00001'] for res in resultsA]

      print(job_names)


if __name__ == '__main__':
    asyncio.run(main())
Traceback (most recent call last):
  File "~/mapepire-samples/concurrent.py", line 1, in <module>
    import asyncio
  File "/usr/lib64/python3.13/asyncio/__init__.py", line 8, in <module>
    from .base_events import *
  File "/usr/lib64/python3.13/asyncio/base_events.py", line 18, in <module>
    import concurrent.futures
  File "~/mapepire-samples/concurrent.py", line 2, in <module>
    from mapepire_python.pool.pool_client import Pool, PoolOptions
  File "~/mapepire-samples/.venv/lib64/python3.13/site-packages/mapepire_python/pool/__init__.py", line 1, in <module>
    from .pool_client import Pool
  File "~/mapepire-samples/.venv/lib64/python3.13/site-packages/mapepire_python/pool/pool_client.py", line 6, in <module>
    from .pool_job import PoolJob
  File "~/mapepire-samples/.venv/lib64/python3.13/site-packages/mapepire_python/pool/pool_job.py", line 8, in <module>
    from pyee.asyncio import AsyncIOEventEmitter
  File "~/mapepire-samples/.venv/lib64/python3.13/site-packages/pyee/asyncio.py", line 3, in <module>
    from asyncio import AbstractEventLoop, ensure_future, Future, iscoroutine, wait
ImportError: cannot import name 'AbstractEventLoop' from partially initialized module 'asyncio' (most likely due to a circular import) (/usr/lib64/python3.13/asyncio/__init__.py)

Versions

Python 3.13.3
dataclasses-json==0.6.7
mapepire-python==0.2.0
marshmallow==3.26.1
mypy_extensions==1.1.0
packaging==25.0
pep249abc==0.0.1b3
pyee==13.0.0
typing-inspect==0.9.0
typing_extensions==4.14.0
websockets==15.0.1

Fedora: 41

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions