Unable to finish setting up SITL on windows

Hi,

I have been trying to install SITL and setting it up following the steps described on this link. I have been through all the steps of setting up Cygwin without any issues (although the procedure to select Cygwin packages isn’t exactly the same as the procedure described in the link anymore, maybe this tutorial is a bit out of date).

But when I try to run SITL from the Cygwin terminal by entering the following command lines :

cd ~/ardupilot/ArduCopter
…/Tools/autotest/sim_vehicle.py --map --console

I get the following error :

ModuleNotFoundError: No module named ‘pymavlink’

I already installed this module by entering the command : pip install pymavlink

I read that it could be because I have two different versions of python installed on my computer and that the pip executable version used is the one of the python version that isn’t used by cygwin.

Does anyone know how to help me with this issue ?

Thanks

pip3 install pymavlink

Does it help?

Just tried, I get this error message :
ERROR: Command errored out with exit status 1:
followed by 20+ lines of error

1 Like

Hi back,

I guess you are using the waf-version as you seem to use Windows guide and cygwin. Did you configure the Copter before using sim_vehicle.py?
Meaning
./waf configure --board sitl
./waf copter
from your cygwin console in arducopter directory.

I did this. It did not change the pymavlink situation using sim_vehicle.py, nor did the “python -m pip install” command help (nor pip3 install pymavlink). Using pip install and having the recent version of pip didn’t help (21.0.1)

It seems wheel can’t be build (successfully installing python package wheel didn’t help) and nobody really wants to decode this: pip3 install pymavlink Collecting pymavlink Using cached pymavlink-2.4.14.tar.gz (4.1 MB) Requirement already satisfied: future in /usr/lib/python3.7/site-packages (from pymavlink) (0.18.2) Collecting lxml Using cached lxml-4.6.3.tar.gz (3.2 MB) Using legacy 'setup.py install' for pymavlink, since package 'wheel' is not installed. Using legacy 'setup.py install' for lxml, since package 'wheel' is not installed. Installing collected packages: lxml, pymavlink Running setup.py install for lxml ... error ERROR: Command errored out with exit status 1: command: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-hkzvjmov/lxml_8b53fd89c71543f8b9646db5f2d3b136/setup.py'"'"'; __file__='"'"'/tmp/pip-install-hkzvjmov/lxml_8b53fd89c71543f8b9646db5f2d3b136/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-9ddj9e84/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python3.7m/lxml cwd: /tmp/pip-install-hkzvjmov/lxml_8b53fd89c71543f8b9646db5f2d3b136/ Complete output (86 lines): Building lxml version 4.6.3. Building without Cython. Building against libxml2 2.9.10 and libxslt 1.1.29 running install running build running build_py creating build creating build/lib.cygwin-3.2.0-x86_64-3.7 creating build/lib.cygwin-3.2.0-x86_64-3.7/lxml copying src/lxml/builder.py -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml copying src/lxml/cssselect.py -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml copying src/lxml/doctestcompare.py -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml copying src/lxml/ElementInclude.py -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml copying src/lxml/pyclasslookup.py -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml copying src/lxml/sax.py -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml copying src/lxml/usedoctest.py -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml copying src/lxml/_elementpath.py -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml copying src/lxml/__init__.py -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml creating build/lib.cygwin-3.2.0-x86_64-3.7/lxml/includes copying src/lxml/includes/__init__.py -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/includes creating build/lib.cygwin-3.2.0-x86_64-3.7/lxml/html copying src/lxml/html/builder.py -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/html copying src/lxml/html/clean.py -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/html copying src/lxml/html/defs.py -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/html copying src/lxml/html/diff.py -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/html copying src/lxml/html/ElementSoup.py -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/html copying src/lxml/html/formfill.py -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/html copying src/lxml/html/html5parser.py -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/html copying src/lxml/html/soupparser.py -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/html copying src/lxml/html/usedoctest.py -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/html copying src/lxml/html/_diffcommand.py -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/html copying src/lxml/html/_html5builder.py -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/html copying src/lxml/html/_setmixin.py -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/html copying src/lxml/html/__init__.py -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/html creating build/lib.cygwin-3.2.0-x86_64-3.7/lxml/isoschematron copying src/lxml/isoschematron/__init__.py -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/isoschematron copying src/lxml/etree.h -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml copying src/lxml/etree_api.h -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml copying src/lxml/lxml.etree.h -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml copying src/lxml/lxml.etree_api.h -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml copying src/lxml/includes/c14n.pxd -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/includes copying src/lxml/includes/config.pxd -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/includes copying src/lxml/includes/dtdvalid.pxd -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/includes copying src/lxml/includes/etreepublic.pxd -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/includes copying src/lxml/includes/htmlparser.pxd -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/includes copying src/lxml/includes/relaxng.pxd -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/includes copying src/lxml/includes/schematron.pxd -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/includes copying src/lxml/includes/tree.pxd -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/includes copying src/lxml/includes/uri.pxd -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/includes copying src/lxml/includes/xinclude.pxd -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/includes copying src/lxml/includes/xmlerror.pxd -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/includes copying src/lxml/includes/xmlparser.pxd -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/includes copying src/lxml/includes/xmlschema.pxd -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/includes copying src/lxml/includes/xpath.pxd -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/includes copying src/lxml/includes/xslt.pxd -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/includes copying src/lxml/includes/__init__.pxd -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/includes copying src/lxml/includes/etree_defs.h -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/includes copying src/lxml/includes/lxml-version.h -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/includes creating build/lib.cygwin-3.2.0-x86_64-3.7/lxml/isoschematron/resources creating build/lib.cygwin-3.2.0-x86_64-3.7/lxml/isoschematron/resources/rng copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/isoschematron/resources/rng creating build/lib.cygwin-3.2.0-x86_64-3.7/lxml/isoschematron/resources/xsl copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/isoschematron/resources/xsl copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/isoschematron/resources/xsl creating build/lib.cygwin-3.2.0-x86_64-3.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1 copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1 copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1 copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1 copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1 copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1 copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.cygwin-3.2.0-x86_64-3.7/lxml/isoschematron/resources/xsl/iso-schematron-xslt1 running build_ext building 'lxml.etree' extension creating build/temp.cygwin-3.2.0-x86_64-3.7 creating build/temp.cygwin-3.2.0-x86_64-3.7/src creating build/temp.cygwin-3.2.0-x86_64-3.7/src/lxml gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/pub/devel/python/python37/python37-3.7.10-1.x86_64/build=/usr/src/debug/python37-3.7.10-1 -fdebug-prefix-map=/pub/devel/python/python37/python37-3.7.10-1.x86_64/src/Python-3.7.10=/usr/src/debug/python37-3.7.10-1 -ggdb -O2 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/pub/devel/python/python37/python37-3.7.10-1.x86_64/build=/usr/src/debug/python37-3.7.10-1 -fdebug-prefix-map=/pub/devel/python/python37/python37-3.7.10-1.x86_64/src/Python-3.7.10=/usr/src/debug/python37-3.7.10-1 -DCYTHON_CLINE_IN_TRACEBACK=0 -I/usr/include/libxml2 -Isrc -Isrc/lxml/includes -I/usr/include/python3.7m -c src/lxml/etree.c -o build/temp.cygwin-3.2.0-x86_64-3.7/src/lxml/etree.o -w src/lxml/etree.c:97:10: fatal error: Python.h: No such file or directory 97 | #include "Python.h" | ^~~~~~~~~~ compilation terminated. Compile failed: command 'gcc' failed with exit status 1 creating tmp cc -I/usr/include/libxml2 -I/usr/include/libxml2 -c /tmp/xmlXPathInitgds8n9iw.c -o tmp/xmlXPathInitgds8n9iw.o cc tmp/xmlXPathInitgds8n9iw.o -lxml2 -o a.out.exe error: command 'gcc' failed with exit status 1 ---------------------------------------- ERROR: Command errored out with exit status 1: /usr/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-hkzvjmov/lxml_8b53fd89c71543f8b9646db5f2d3b136/setup.py'"'"'; __file__='"'"'/tmp/pip-install-hkzvjmov/lxml_8b53fd89c71543f8b9646db5f2d3b136/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-9ddj9e84/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python3.7m/lxml Check the logs for full command output.

Coming from Ubuntu 18.04 where it immediately ran after building I am desperate. Any Updates?

I used also both version to try to start the map and the console. autotest and from within ArduCopter

This is the root of the error. You’ve not installed the Python 3 development (python37-devel in your case) package. Check the wiki for list of required Cygwin packages: Setting up the waf Build Environment on Windows using Cygwin — Dev documentation

I am having the same error, I think this error occurs even if you installed python correctly.