Python error


#1
Starting copter simulator (SITL)

SITL already Downloaded and Extracted.
Ready to boot.
Traceback (most recent call last):
File “/home/dronedojo/courseRoot/dk/dk/LaunchSkyCasterStealth.py”, line 116, in
vehicle = connectMyCopter()
File “/home/dronedojo/courseRoot/dk/dk/LaunchSkyCasterStealth.py”, line 24, in connectMyCopter
sitl = dronekit_sitl.start_default()
File “/home/johnny/.local/lib/python3.9/site-packages/dronekit_sitl/init.py”, line 462, in start_default
sitl.launch(sitl_args, await_ready=True, restart=True)
File “/home/johnny/.local/lib/python3.9/site-packages/dronekit_sitl/init.py”, line 251, in launch
caps = ArdupilotCapabilities(self.path)
File “/home/johnny/.local/lib/python3.9/site-packages/dronekit_sitl/init.py”, line 160, in init
process = subprocess.Popen([path, ‘–help’], stdout=subprocess.PIPE)
File “/usr/lib/python3.9/subprocess.py”, line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File “/usr/lib/python3.9/subprocess.py”, line 1821, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: ‘/home/johnny/.dronekit/sitl/copter-3.3/apm’
johnny@johnny-desktop:/home/dronedojo/courseRoot/dk/dk$ python3 LaunchSkyCasterStealth.py
Starting copter simulator (SITL)
SITL already Downloaded and Extracted.
Ready to boot.
Traceback (most recent call last):
File “/home/dronedojo/courseRoot/dk/dk/LaunchSkyCasterStealth.py”, line 116, in
vehicle = connectMyCopter()
File “/home/dronedojo/courseRoot/dk/dk/LaunchSkyCasterStealth.py”, line 24, in connectMyCopter
sitl = dronekit_sitl.start_default()
File “/home/johnny/.local/lib/python3.9/site-packages/dronekit_sitl/init.py”, line 462, in start_default
sitl.launch(sitl_args, await_ready=True, restart=True)
File “/home/johnny/.local/lib/python3.9/site-packages/dronekit_sitl/init.py”, line 251, in launch
caps = ArdupilotCapabilities(self.path)
File “/home/johnny/.local/lib/python3.9/site-packages/dronekit_sitl/init.py”, line 160, in init
process = subprocess.Popen([path, ‘–help’], stdout=subprocess.PIPE)
File “/usr/lib/python3.9/subprocess.py”, line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File “/usr/lib/python3.9/subprocess.py”, line 1821, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: ‘/home/johnny/.dronekit/sitl/copter-3.3/apm’

Any idea of how to resolve this? I am trying to migrate all the files from the VirtualBox onto a physical Ubuntu RaspberryPi & am close to having it working…Minus this last error message… Any ideas?


#2

Hi there @northdacoder!

Sorry for the delay.

You may run into problems because the VM (in the course) uses python2 and it looks like you’re trying to port to python3. There is a good guide on how you can get the course material up and running with python3 and ubuntu 20.04 by @dash, though I have not done this yet.

May I ask why you’re wanting to run SITL from the PI as opposed to on a desktop/laptop?