ZeroMQ non blocking example error

Typically: "How do I... ", "How can I... " questions
Post Reply
pwyq
Posts: 18
Joined: 28 May 2021, 19:30

ZeroMQ non blocking example error

Post by pwyq »

Hi,

I am trying to switch from Python Legacy Remote API to ZeroMQ as suggested, but I have encountered a bit more resistence than expected. One of the problems I would like to ask for help:

While I tried to run code from "simpleTest-nonBlocking.py" and with example scene "controlledViaZmq.ttt", I got the following error and I couldn't find a solution online.

Code: Select all

Program started
Traceback (most recent call last):
  File "/home/....../zeromq_nonblocking.py", line 92, in <module>
    asyncio.run(mainFunc())
  File "/home/....../lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/home/....../lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/home/....../zeromq_nonblocking.py", line 23, in mainFunc
    async with RemoteAPIClient() as client:
AttributeError: __aenter__
Could you provide some hints on how to resolve this issue? Thank you.

fferri
Posts: 1309
Joined: 09 Sep 2013, 19:28

Re: ZeroMQ non blocking example error

Post by fferri »

simpleTest-nonBlocking.py appears to work fine here (tested with Python 3.8 and 3.9).

Please post the content of /home/....../zeromq_nonblocking.py and provide additional details about your setup (OS, python version, ....).

pwyq
Posts: 18
Joined: 28 May 2021, 19:30

Re: ZeroMQ non blocking example error

Post by pwyq »

I just renamed simpleTest-nonBlocking.py to zeromq_nonblocking.py and changed the import path of zmqRemoteApi for my own workspace. Nothing else.

OS: Ubuntu 18.04.6 LTS
Python: 3.9.7
CoppeliaSim: V4.3.0 (rev. 3) flavor: 1

A new minimal conda environment is used for this task. Conda config:

Code: Select all

name: ......
channels:
  - defaults
dependencies:
  - _libgcc_mutex=0.1
  - _openmp_mutex=4.5
  - ca-certificates=2021.10.26
  - certifi=2021.10.8
  - ld_impl_linux-64=2.35.1
  - libffi=3.3
  - libgcc-ng=9.3.0
  - libgomp=9.3.0
  - libstdcxx-ng=9.3.0
  - ncurses=6.3
  - openssl=1.1.1m
  - pip=21.2.4
  - python=3.9.7
  - readline=8.1.2
  - setuptools=58.0.4
  - sqlite=3.37.2
  - tk=8.6.11
  - tzdata=2021e
  - wheel=0.37.1
  - xz=5.2.5
  - zlib=1.2.11
  - pip:
    - cbor==1.0.0
    - pyzmq==22.3.0

fferri
Posts: 1309
Joined: 09 Sep 2013, 19:28

Re: ZeroMQ non blocking example error

Post by fferri »

Looks like you are using the non-asyncio client (due to __aenter__ not being found).

But didn't provide enough details to reproduce your problem.

Post Reply