Errors while setting up SITL on Windows

I Installed Cygwin as described and downloaded MAVProxy for Windows. After that, I opened the Cygwin64 terminal and navigated to one of the vehicle directories (in this case Copter) and then called sim_vehicle.py to start SITL. I ran the following commands in the terminal:

…/Tools/autotest/sim_vehicle.py --map --console

The following lines outlining the errors is what I received in the terminal after running the above command.

SIM_VEHICLE: Start
SIM_VEHICLE: Killing tasks
SIM_VEHICLE: kill_tasks failed: a bytes-like object is required, not ‘str’
SIM_VEHICLE: Starting up at -35.363261,149.165230,584,353 (CMAC)
SIM_VEHICLE: WAF build
SIM_VEHICLE: Configure waf
SIM_VEHICLE: “/home/user/ardupilot/modules/waf/waf-light” “configure” “–board” “sitl”
Traceback (most recent call last):
File “/home/user/ardupilot/modules/waf/waflib/Node.py”, line 579, in ant_iter
raise StopIteration
StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/home/user/ardupilot/modules/waf/waflib/Scripting.py”, line 165, in waf_entry_point
run_commands()
File “/home/user/ardupilot/modules/waf/waflib/Scripting.py”, line 262, in run_commands
parse_options()
File “/home/user/ardupilot/modules/waf/waflib/Scripting.py”, line 214, in parse_options
Context.create_context(‘options’).execute()
File “/home/user/ardupilot/modules/waf/waflib/Options.py”, line 271, in execute
super(OptionsContext, self).execute()
File “/home/user/ardupilot/modules/waf/waflib/Context.py”, line 205, in execute
self.recurse([os.path.dirname(g_module.root_path)])
File “/home/user/ardupilot/modules/waf/waflib/Context.py”, line 287, in recurse
user_function(self)
File “/home/user/ardupilot/wscript”, line 49, in options
opt.load(‘compiler_cxx compiler_c waf_unit_test python’)
File “/home/user/ardupilot/modules/waf/waflib/Context.py”, line 197, in load
fun(self)
File “/home/user/ardupilot/modules/waf/waflib/Tools/compiler_cxx.py”, line 103, in options
opt.load_special_tools(‘cxx_*.py’)
File “/home/user/ardupilot/modules/waf/waflib/Context.py”, line 609, in load_special_tools
lst = self.root.find_node(waf_dir).find_node(‘waflib/extras’).ant_glob(var)
File “/home/user/ardupilot/modules/waf/waflib/Node.py”, line 672, in ant_glob
ret = [x for x in self.ant_iter(accept=accept, pats=[to_pat(incl), to_pat(excl)], maxdepth=kw.get(‘maxdepth’, 25), dir=dir, src=src, remove=kw.get(‘remove’, True))]
File “/home/user/ardupilot/modules/waf/waflib/Node.py”, line 672, in
ret = [x for x in self.ant_iter(accept=accept, pats=[to_pat(incl), to_pat(excl)], maxdepth=kw.get(‘maxdepth’, 25), dir=dir, src=src, remove=kw.get(‘remove’, True))]
RuntimeError: generator raised StopIteration
SIM_VEHICLE: (Configure waf) exited with code 512
SIM_VEHICLE: Killing tasks
SIM_VEHICLE: kill_tasks failed: a bytes-like object is required, not ‘str’

I tried reading about these errors on the forums but could not find any solid solution.

This looks like a python2 vs python3 issue.

Make sure you use either 2 or 3, but not both. Mixing them gives you this kind of error.