Error while running sim_vehicle.py

Hello everyone. I’m new with ardupilot and I have a problem with compiling sim_vehicle
SIM_VEHICLE: Start
SIM_VEHICLE: Killing tasks
SIM_VEHICLE: Starting up at SITL location
SIM_VEHICLE: WAF build
SIM_VEHICLE: Configure waf
SIM_VEHICLE: “/home/oppenheimer/apm/ardupilot/modules/waf/waf-light” “configure” “–board” “sitl”
/usr/bin/env: ‘python’: No such file or directory
SIM_VEHICLE: (Configure waf) exited with code 32512
SIM_VEHICLE: Killing tasks

is there anyone know how to sole it?
Thanks

I am having the same issue - did you ever resolve this?

This is a problem with the python version. Go to ./ardupilot/modules/waf and in the file waf-light change first line: #!/usr/bin/env python to #!/usr/bin/env python3

2 Likes

Hi there,
I am having exactly the same issue as Oppenheimer. Unfortunately, Tessa_H’s solution did not work for me. Any other suggestions?

Here is my shell command:
python /mnt/c/users/andre/onedrive/create/ardupilot/tools/autotest/sim_vehicle.py -w -v ArduPlane

Here is the result:

SIM_VEHICLE: Start
SIM_VEHICLE: Killing tasks
SIM_VEHICLE: Starting up at SITL location
SIM_VEHICLE: WAF build
SIM_VEHICLE: Configure waf
SIM_VEHICLE: "/mnt/c/users/andre/onedrive/create/ardupilot/modules/waf/waf-light" "configure" "--board" "sitl"
/usr/bin/env: ‘python3\r’: No such file or directory
SIM_VEHICLE: (Configure waf) exited with code 32512
SIM_VEHICLE: Killing tasks

I am running on Windows 11 using WSL Ubuntu.
Any hint would be fentastic.
Thanks in advance.

try with python3 instead of python maybe ?
python3 /mnt/c/users/andre/onedrive/create/ardupilot/tools/autotest/sim_vehicle.py -w -v ArduPlane

Dear A.Larribau, thanks very much for your quick support!!! And sorry for my late very reply.

Unfortunately, switching to “python3” did not slove the problem. Instead, I found the following solution:

  • Step 1: Download “dos2unix”
    sudo apt install dos2unix

  • Step 2: Convert “waf-light” to Unix format:
    dos2unix /mnt/c/users/andre/onedrive/create/ardupilot/modules/waf/waf-light

  • Step 3: Re-run my command:
    python /mnt/c/users/andre/onedrive/create/ardupilot/tools/autotest/sim_vehicle.py -w -v ArduPlane

The cause of the problem was apparently the line ending characters which are different in Unix (LF) and Windows (CR + LF).

1 Like

SIM_VEHICLE: Start
SIM_VEHICLE: Killing tasks
SIM_VEHICLE: Starting up at SITL location
SIM_VEHICLE: WAF build
SIM_VEHICLE: Configure waf
SIM_VEHICLE: “/home/BABAR/ardupilot/modules/waf/waf-light” “configure” “–board” “sitl”
Error: waf-light requires waflib → export WAFDIR=/folder
SIM_VEHICLE: (Configure waf) exited with code 256
SIM_VEHICLE: Killing tasks

anyone please guide how to fix it @A.Larribau @TrueAquarius @Karol_W @Oppenheimer @

Did you try the recursive cloning. Refer here

This worked. Thank you. Curious why adding the “alias python=python3” is not sufficient.