Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dronekit-sitl not work with new version python. #1182

Open
ghost opened this issue Feb 13, 2023 · 8 comments
Open

dronekit-sitl not work with new version python. #1182

ghost opened this issue Feb 13, 2023 · 8 comments

Comments

@ghost
Copy link

ghost commented Feb 13, 2023

Hello.

it seems that dronekit-SITL not works with newer version python.

it generates error after I update the python.

following error message orrcurs when I connect to dronekit-sitl. :

File "C:\Users\xxx.conda\envs\xxx\lib\site-packages\dronekit\mavlink.py", line 127, in init
if ip.startswith("udpin:"):
AttributeError: 'SITL' object has no attribute 'startswith'


I changed all variable to string by str() but since I don't know about entire code structure, I failed.

@kyrlon
Copy link

kyrlon commented Feb 18, 2023

what version of python are you running?

@ghost
Copy link
Author

ghost commented Feb 18, 2023

Im using latest python, 3.9.16

I remember I tried 3.9.10,3.9.0 but I'm not sure about the version I tried.

@kyrlon
Copy link

kyrlon commented Feb 20, 2023

try a virtual environment to make sure it is not a conflict with your system install:

PS C:\Users\kyrlon\Desktop> py -m venv env1
PS C:\Users\kyrlon\Desktop> .\env1\Scripts\activate
(env1) PS C:\Users\kyrlon\Desktop> py -m pip install dronekit-sitl
Collecting dronekit-sitl
  Using cached dronekit_sitl-3.3.0-py3-none-any.whl (38 kB)
Collecting psutil>=3.0
  Using cached psutil-5.9.4-cp36-abi3-win_amd64.whl (252 kB)
Collecting six>=1.10
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting dronekit>=2.0.0b6
  Using cached dronekit-2.9.2-py3-none-any.whl (56 kB)
Collecting monotonic>=1.3
  Using cached monotonic-1.6-py2.py3-none-any.whl (8.2 kB)
Collecting pymavlink>=2.2.20
  Using cached pymavlink-2.4.37-py3-none-any.whl (5.8 MB)
Collecting future
  Using cached future-0.18.3.tar.gz (840 kB)
Collecting lxml
  Using cached lxml-4.9.2-cp39-cp39-win_amd64.whl (3.9 MB)
Using legacy 'setup.py install' for future, since package 'wheel' is not installed.
Installing collected packages: lxml, future, pymavlink, monotonic, six, psutil, dronekit, dronekit-sitl
    Running setup.py install for future ... done
Successfully installed dronekit-2.9.2 dronekit-sitl-3.3.0 future-0.18.3 lxml-4.9.2 monotonic-1.6 psutil-5.9.4 pymavlink-2.4.37 six-1.16.0
WARNING: You are using pip version 21.2.3; however, version 23.0.1 is available.
You should consider upgrading via the 'C:\Users\kyrlon\Desktop\env1\Scripts\python.exe -m pip install --upgrade pip' command.
(env1) PS C:\Users\kyrlon\Desktop> py --version
Python 3.9.7

@ghost
Copy link
Author

ghost commented Feb 20, 2023

try a virtual environment to make sure it is not a conflict with your system install:

PS C:\Users\kyrlon\Desktop> py -m venv env1
PS C:\Users\kyrlon\Desktop> .\env1\Scripts\activate
(env1) PS C:\Users\kyrlon\Desktop> py -m pip install dronekit-sitl
Collecting dronekit-sitl
  Using cached dronekit_sitl-3.3.0-py3-none-any.whl (38 kB)
Collecting psutil>=3.0
  Using cached psutil-5.9.4-cp36-abi3-win_amd64.whl (252 kB)
Collecting six>=1.10
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting dronekit>=2.0.0b6
  Using cached dronekit-2.9.2-py3-none-any.whl (56 kB)
Collecting monotonic>=1.3
  Using cached monotonic-1.6-py2.py3-none-any.whl (8.2 kB)
Collecting pymavlink>=2.2.20
  Using cached pymavlink-2.4.37-py3-none-any.whl (5.8 MB)
Collecting future
  Using cached future-0.18.3.tar.gz (840 kB)
Collecting lxml
  Using cached lxml-4.9.2-cp39-cp39-win_amd64.whl (3.9 MB)
Using legacy 'setup.py install' for future, since package 'wheel' is not installed.
Installing collected packages: lxml, future, pymavlink, monotonic, six, psutil, dronekit, dronekit-sitl
    Running setup.py install for future ... done
Successfully installed dronekit-2.9.2 dronekit-sitl-3.3.0 future-0.18.3 lxml-4.9.2 monotonic-1.6 psutil-5.9.4 pymavlink-2.4.37 six-1.16.0
WARNING: You are using pip version 21.2.3; however, version 23.0.1 is available.
You should consider upgrading via the 'C:\Users\kyrlon\Desktop\env1\Scripts\python.exe -m pip install --upgrade pip' command.
(env1) PS C:\Users\kyrlon\Desktop> py --version
Python 3.9.7

Thank you for your reply. Im already using virtual environment as you can see in my error message. do you run your dronekit sitl well in windows?

@kyrlon
Copy link

kyrlon commented Feb 22, 2023

I was able to install on my Windows 10 machine, but I have not been successful in running the sitl efficiently. I have been having a similar issue where after 10 secs, the sitl disarms the motors. The only solution is to downgrade to python3.6 and also install pymavlink==2.4.8, which both options I would prefer not to result to.

@kyrlon
Copy link

kyrlon commented Jun 21, 2023

I ended up using a docker container suggested from this repo. I ended up just pulling the image directly

@hamishwillee
Copy link
Contributor

@peterbarker Is there any plan to update Dronekit Sitl to Python 3? It's a pretty useful tool.

@ItayShiff
Copy link

Any update on this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants