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?

2 Likes

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

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 sim_vehicle.py --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 sim_vehicle.py -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 ‘sim_vehicle.py’: [Errno 2] No such file or directory
this error help me out

Hi,
I am still getting the same error as:
Traceback (most recent call last):
File “…/Tools/autotest/sim_vehicle.py”, 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/setup.py’"’"’; file=’"’"’/tmp/pip-install-v1wnz5ax/lxml_5990454f613d4e968eeaed9d73812175/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-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):

thanks

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 (github.com)

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

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/dist.py”, line 732, in fetch_build_egg
return fetch_build_egg(self, req)
File “/usr/lib/python3.8/site-packages/setuptools/installer.py”, 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 https://files.pythonhosted.org/packages/2e/92/0d7b276851a9d99c26cad7c301fd55dc68d77af7abc557ee4795e62a9c72/pymavlink-2.2.9.tar.gz#sha256=a8b875a9ecfa9aea5588743365a07f732f9c0bb762ecc971a5f91046f00f910b (from https://pypi.org/simple/pymavlink/). Command errored out with exit status 1: python setup.py 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 ‘setup.py install’ for pymavlink, since package ‘wheel’ is not installed.
Using legacy ‘setup.py install’ for future, since package ‘wheel’ is not installed.
Installing collected packages: future, pymavlink
Running setup.py install for future … done
Running setup.py 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/sim_vehicle.py --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.

2 Likes

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/sim_vehicle.py --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.