MAVSDK-Python: KeyError: 'Action' when running example script

I just completed the build of DronecodeSDK-Python as per directions I got from the dev team. I did all the updates and installed Python 3.6, and everything appeared to install OK.

The GUI runs and I can get the drone to takeoff and land with manual commands. The backend is installed and works fine. But I just can’t get the script to run. I tried to run the sample script but it threw an error. Can someone look at this and see what the problem might be?

Thanks, Joe

joe-pl@joe-PL:/src/DronecodeSDK/DronecodeSDK-Python$  python3.6 examples/takeoff_and_land.py
Traceback (most recent call last):
  File "examples/takeoff_and_land.py", line 7, in <module>
    drone = dronecode_sdk_connect(host="127.0.0.1")
  File "/src/DronecodeSDK/DronecodeSDK-Python/dronecode_sdk/__init__.py", line 49, in connect
    globals()[plugin](plugin_manager)
KeyError: 'Action'

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 16

Most upvoted comments

Woohoo!

So let’s summarize:

  • You installed python3.6 and pip3.6.
  • You updated the python-sdk installation script to use python3.6 and pip3.6 instead of python3 and pip3.
  • You generated the python-sdk code by running run_protoc.sh.
  • You installed the generated sdk with pip3.6 install -e .
  • You could then run the example (python3.6 example/takeoff_and_land.py)

My only question is what will the result be of deleting ~/DronecodeSDK instead of ~/DronecodeSDK-Python? So far I haven’t seen any issues, but I wonder.

In the whole process, you apparently cloned the repository twice, which added confusion. You only needed it once. Removing one or the other was not important, but I advised you to remove the one that was not fixed yet (i.e. that had not the “python3” and “pip3” commands replaced by “python3.6” and “pip3.6”.

So it seems all good! Have fun with the SDK 👍

EUREKA! It finally worked, despite the fact that I deleted the wrong file. I was able to use sudo pip3.6 install -e . and it installed correctly. After that running the script worked for the first time. Thank you so much for your patience and assistance.

My only question is what will the result be of deleting ~/DronecodeSDK instead of ~/DronecodeSDK-Python? So far I haven’t seen any issues, but I wonder.

Thanks again, Joe

Jonas: Julian asked for this on the forum and I already sent it. Thanks, Joe

On Wed, Feb 13, 2019 at 6:02 PM Jonas Vautherin notifications@github.com wrote:

Can you show me your ./other/tools/run_protoc.sh and the output when you run it?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Dronecode/DronecodeSDK-Python/issues/48#issuecomment-463411336, or mute the thread https://github.com/notifications/unsubscribe-auth/Ahmw51CZ0YO-YIpMjGHtFudlTWPOfzZZks5vNJlvgaJpZM4a6KQy .

– Joe-RCav8r