ArduPilot / pymavlink

python MAVLink interface and utilities
Other
491 stars 591 forks source link

Invalid syntax #849

Open anunarayan13 opened 1 year ago

anunarayan13 commented 1 year ago

from pymavlink.dialects.v10 import ardupilotmega as MAV_APM File "/usr/local/lib/python2.7/dist-packages/pymavlink-2.4.39-py2.7.egg/pymavlink/dialects/v10/ardupilotmega.py", line 56 def init(self, buf: Optional[Sequence[int]] = None) -> None: ^ SyntaxError: invalid syntax

Please resolve

shancock884 commented 10 months ago

From your path it looks like you are using python2.7 - the website suggests that pymavlink is only supported from Python 3.5 onwards, so maybe this is the reason. (to be confirmed by someone more authoritative than me...)

Menny11 commented 10 months ago

pymavlink is used by dronekit and there is only 2.7 python supported(( I don't now why the support for py2 in the pymavlink is removed(

khancyr commented 10 months ago

py2 is deprecatead since some years already and it become too hard to maintain compatiblity with it as most project are dropping py2, so ArduPilot move to python3 only and update most of its tools for this.

furkanisikay commented 8 months ago

please run this command on your terminal to using pymavlink 2.4.37. it going to fix your problem.

pip install --force-reinstall -v "pymavlink==2.4.37"