Servers by jDrones

No module named pymavlink ERROR

when trying to run:

sim_vehicle.py -w

I am getting an error saying:

Traceback (most recent call last):
File “/home/odroid/ardupilot/Tools/autotest/sim_vehicle.py”, line 25, in
from pymavlink import mavextra
ImportError: No module named pymavlink

I was wondering if anyone has come across this error or knows what I am needing to do to stop this from happening. Thanks.

you can install pymavlink with pip

pip install -U pymavlink

a search in the ardupilot source code found this:

modules/mavlink/README.md
13:* Source: Mavlink Generator
14:* Discussion: Gitter Channel

I just happened to need the latest version of ardupilot, so i cloned the repo again. After the initial git clone command you need to cd to the ardupilot directory and run:
git submodule update --init --recursive

That will sync and download various submodules need by ardupilot, and I noticed pymavlink was one of them.

I did the pip install. Now I am left with this error.

RiTW: Starting APMrover2 : /home/odroid/ardupilot/build/sitl/bin/ardurover -S -I0 --model rover --speedup 1 --defaults /home/odroid/ardupilot/Tools/autotest/default_params/rover.parm
[Run MavProxy] An exception has occurred with command: ‘mavproxy.py --master tcp:127.0.0.1:5760 --sitl 127.0.0.1:5501 --out 127.0.0.1:14550 --out 127.0.0.1:14551 --map --console’
[Errno 2] No such file or directory
SIM_VEHICLE: Killing tasks

you need to update the submodules under ardupilot:

after git cloning, cd to ardupilot directory and run
git submodule update --init --recursive

that will download many more modules needed by ardupilot, including the python scripts you are missing.

you should also run git submodule update --recursive after updating ardupilot, for example when checking out a branch or running git origin pull.

when I do either of the commands you say it does not show anything on my screen. I hit enter and then it just goes straight to the next line waiting for another command. Thanks

also after I run sim_vehicle.py -w -v ArduCopter. I get that output still but I forgot to say that I get another screen called ArduCopter and it says stuff and the last line is waiting for connection…

what directory are you running the command from? I need to look into running SITL. Did you have to build ardupilot first? Without submodules the build should have failed.

it is working now for some reason.

It takes a couple of minutes to start on my laptop. If necessary you can install mavproxy with pip.

Servers by jDrones