Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: init() got an unexpected keyword argument 'encoding' when calling client.simGetImage #4797

Open
amadorneto opened this issue Feb 20, 2023 · 1 comment

Comments

@amadorneto
Copy link

Bug report

  • AirSim Version/#commit: 1.8.1
  • UE/Unity version: Unreal 4.27.2
  • autopilot version: N/A
  • OS Version: Ubuntu 20.04.5

What's the issue you encountered?

I tried to take one image from the Car simulation and followed the code shown in https://microsoft.github.io/AirSim/image_apis/. Still, it's not running and giving the error TypeError: init() got an unexpected keyword argument 'encoding'.
I tried upgrading the packages msgpack-rpc-python (0.4.1), msgpack-python (0.5.6), and msgpack (1.0.4), besides installing the package msgpack-numpy (0.4.8), but it didn't solve the problem.
I'm using Python 3.8.

Settings

I didn't change the camera settings.

How can the issue be reproduced?

To execute the python script shown in https://gist.github.com/amadorneto/9327a9aac6f5538ef56c8a71254822a3 using Python 3.8.

Include full error message in text form

Traceback (most recent call last):
File "camera_example.py", line 6, in
png_image = client.simGetImage("0", airsim.ImageType.Scene)[0]
File "/home/amador/.local/lib/python3.8/site-packages/airsim/client.py", line 287, in simGetImage
result = self.client.call('simGetImage', camera_name, image_type, vehicle_name, external)
File "/home/amador/.local/lib/python3.8/site-packages/msgpackrpc/session.py", line 41, in call
return self.send_request(method, args).get()
File "/home/amador/.local/lib/python3.8/site-packages/msgpackrpc/session.py", line 51, in send_request
self._transport.send_message([message.REQUEST, msgid, method, args])
File "/home/amador/.local/lib/python3.8/site-packages/msgpackrpc/transport/tcp.py", line 89, in send_message
self.connect()
File "/home/amador/.local/lib/python3.8/site-packages/msgpackrpc/transport/tcp.py", line 98, in connect
socket = ClientSocket(stream, self, self._encodings)
File "/home/amador/.local/lib/python3.8/site-packages/msgpackrpc/transport/tcp.py", line 53, in init
BaseSocket.init(self, stream, encodings)
File "/home/amador/.local/lib/python3.8/site-packages/msgpackrpc/transport/tcp.py", line 12, in init
self._packer = msgpack.Packer(encoding=encodings[0], default=lambda x: x.to_msgpack())
File "msgpack/_packer.pyx", line 124, in msgpack._cmsgpack.Packer.init
TypeError: init() got an unexpected keyword argument 'encoding'

What's better than filing an issue? Filing a pull request :).

@xinzhichao
Copy link

i get the same error. have you solve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants