Ubuntu 20 + Python3 setup


I just would like to thank you dash for sharing your experience here. Thanks to your information, I just went through the DPP course successfully! Mine was as follows.

$ pip freeze | grep -i mav

$ pip freeze | grep -i drone

As you suggested, what I did was to downgrade pymavlink==2.4.15–>>pymavlink==2.4.8 in the virtual environment and hand over vehicle object to some functions. Since I use a very old laptop (EPSON Endeavor) in which Ubuntu 20.04.2 LTS was already installed, your information helped me a lot!


I tried this with 21.04 but no luck. Got stuck installing prior version of pymavlink.


You are welcome, glad to be of help!


Hey sorry for the late reply. Did you figure it out? Is it still relevant for you?


NBD. 20.04 worked, tried 21.04 just for kicks.


Hi, thank you so much for your help!

I have however been experiencing the following timeout error and have no idea why…

Starting copter simulator (SITL)
SITL already Downloaded and Extracted.
Ready to boot.

Connecting to vehicle on: tcp:
WARNING:dronekit:Link timeout, no heartbeat in last 5 seconds
ERROR:dronekit.mavlink:Exception in MAVLink input loop
Traceback (most recent call last):
File “/usr/local/lib/python3.8/dist-packages/dronekit/mavlink.py”, line 211, in mavlink_thread_in
File “/usr/local/lib/python3.8/dist-packages/dronekit/init.py”, line 1370, in listener
raise APIException(‘No heartbeat in %s seconds, aborting.’ %
dronekit.APIException: No heartbeat in 30 seconds, aborting.
Traceback (most recent call last):
File “vehicle_state.py”, line 38, in
vehicle = connect(connection_string, wait_ready=True)
File “/usr/local/lib/python3.8/dist-packages/dronekit/init.py”, line 3166, in connect
vehicle.initialize(rate=rate, heartbeat_timeout=heartbeat_timeout)
File “/usr/local/lib/python3.8/dist-packages/dronekit/init.py”, line 2275, in initialize
raise APIException(‘Timeout in initializing connection.’)
dronekit.APIException: Timeout in initializing connection

Any advice would be appreciated

launchSitl "can't find '__main__' in module in ' ' error

I am running SITL in 20.04 without issue.

I can tell from your other posts you have a better grasp on code than I, so my only take is either you did not install something correctly or you ran the SITL incorrectly.

Is this through the bash launchSitl or sim_vehicle.py ?

Are you in virtualenv ?

If you want to print out your install steps and how you executed the SITL I would be happy to look at it. Maybe list out your bash file too.


Hey @dash! Thank you very much for this huge update! I tried the drone programming course with the old set-up but ran into the “submodule update --init recursive” issue so I am going to scrap it and try with updated versions of software. Have you also done the prcision landing module with this updated software?