Cygwin64 no module named Pymavlink

Hey guys! I exactly went through the Cygwin Download and SITL but I get the error no module named Pymavlink. I did Pip install pymavlink/ python3 -m pip install pymavlink/pipwin install pymavlink( I was desperate lol). Any advices

1 Like

At which stage you get that error message?
Send us the complete command window output (as text or screenshot).
Did you get any error when installing pymavlink?


Okay. Here is the cygwin terminal:
I get the error when: …/Tools/autotest/ --map --console

Do you get the same error message when you do the below commands, try them.

  1. python -m pip install pymavlink
  2. cd Tools/autotest
  3. python --map --console

cd Tools/autotest: No Such File or directory

I assumed you are at the ardupilot directory.
cd ardupilot/Tools/autotest
Since you are out of the arducopter directory you might need to do
python -v ArduCopter --map --console

Hello I am getting the same error. I am not since why since I can see the module named pymavlink. It is located under /modules/mavlink/. Any help would be appreciated!

Had exactly the same issue, decided to run SITL on a VM running Ubuntu instead, works perfectly.

on running this command i am gettting python: can’t open file ‘’: [Errno 2] No such file or directory
this error help me out

I am still getting the same error as:
Traceback (most recent call last):
File “…/Tools/autotest/”, line 30, in
from pymavlink import mavextra
ModuleNotFoundError: No module named ‘pymavlink’

I tried to install pymavlink separately and I got this 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-v1wnz5ax/lxml_5990454f613d4e968eeaed9d73812175/’"’"’; file=’"’"’/tmp/pip-install-v1wnz5ax/lxml_5990454f613d4e968eeaed9d73812175/’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, file, ‘"’"‘exec’"’"’))’ install --record /tmp/pip-record-gqvggv1h/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python3.7m/lxml
cwd: /tmp/pip-install-v1wnz5ax/lxml_5990454f613d4e968eeaed9d73812175/
Complete output (86 lines):


These pymavlink issues are coming up with many people on the native windows build. Check
Unable to finish setting up SITL on windows - General - ArduPilot Discourse

Pip installation fails · Issue #222 · ArduPilot/pymavlink (

Always worth a shot installing pymavlink seperately. Link:
MAVProxy crashes after reinstallation, when adding new MAVLink message · Issue #623 · ArduPilot/MAVProxy (

Hello, have you solved this problem? I have exact the same issue

No I couldnt sorry :frowning:

First, uninstall pymavlink.

python -m pip install --upgrade pymavlink
Please do a version-specific dependency check.
I had the same problem, but I solved it.
The final version was 2.2.8.

return installer(requirement)
File “/usr/lib/python3.8/site-packages/setuptools/”, line 732, in fetch_build_egg
return fetch_build_egg(self, req)
File “/usr/lib/python3.8/site-packages/setuptools/”, line 128, in fetch_build_egg
raise DistutilsError(str(e)) from e

distutils.errors.DistutilsError: Command '['/usr/bin/python', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpxywwrwzf', '--quiet', 'future']' returned non-zero exit status 1.

WARNING: Discarding (from Command errored out with exit status 1: python egg_info Check the logs for full command output.
Using cached pymavlink-2.2.8.tar.gz (3.0 MB)
Collecting future
Using cached future-0.18.2.tar.gz (829 kB)
Requirement already satisfied: lxml in /usr/local/lib/python3.8/site-packages (from pymavlink) (4.6.3)
Using legacy ‘ install’ for pymavlink, since package ‘wheel’ is not installed.
Using legacy ‘ install’ for future, since package ‘wheel’ is not installed.
Installing collected packages: future, pymavlink
Running install for future … done
Running install for pymavlink … done
Successfully installed future-0.18.2 pymavlink-2.2.8

1 Like

I encountered the same error message when running “…/Tools/autotest/ --map --console”.
I tried to “pip install pymavlink” and it showed me I already had it.
I searched within the “ardupilot” directory and found it at “C:\cygwin64\home\[user]\ardupilot\modules\mavlink”.
Then I copied the “pymavlink” folder to “C:\cygwin64\home\[user]\ardupilot\Tools\autotest” and it worked.


Heitor your solution was the only one that worked for me, thanks you so much!
In case anyone missed, while doing that you must have cygwin closed. Then open MavProxy (No GUI) and then execute cygwin again, finally you write this: cd ~/ardupilot/ArduCopter
…/Tools/autotest/ --map --console.

I tried to install/update pymavlink and it was throwing error that “python.h” not found.
For me the below solution worked:
rm /usr/bin/python
ln -s /usr/bin/python3.6 /usr/bin/python

1 Like

@Arindam_Khanda 's solution worked for me.

Hello experts,

Has anyone has tried to work Dronekit-SITL in ubuntu 21.1?
I just couldn’t get it to work bec of the problem “ImportError: No module named pymavlink”. I have tried everything suggestions from this thread-topic but failed. I appreciate your help. Thank you.