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

Using python 3.10 or 3.11 may cause [!] MAVSDK-Python is only available on Python >= 3.6 issue #540

Closed
Nomed73 opened this issue Jan 6, 2023 · 3 comments

Comments

@Nomed73
Copy link

Nomed73 commented Jan 6, 2023

The file init.py checks for compatibility. However, if you are using python version 3.10 or higher it makes it incompatible.

The line
if float(".".join(platform.python_version_tuple()[0:-1])) < 3.6
is checking float values. So 3.10 and 3.11 are less than 3.60, which is the value the code is checking.

I made the following adjustments to correct for this and this seems to be working.

# Accounting for version 3.10.x and 3.11.x
python_p1 = float(platform.python_version_tuple()[0])
python_p2 = float(platform.python_version_tuple()[1])

if (python_p1 == 2 or (python_p1 == 3 and python_p2 < 6)):
    print("[!] MAVSDK-Python is only available on Python >= 3.6")
    sys.exit(1)

Just in case others were running into this issue.

@JonasVautherin
Copy link
Collaborator

Oh, I just answered on the other issue. Same thing here: would you mind opening a PR with your proposed changes? 😇

@Nomed73 Nomed73 closed this as completed Jan 6, 2023
@JonasVautherin
Copy link
Collaborator

Seems like it was due to an outdated version of mavsdk-python.

@alexbhandari
Copy link

On ARM based Macs the latest available version from pip is 0.12.0 (see mavlink/MAVSDK#1989 ), which has this problem. So this fix was useful on those platforms where this bug is present and would prevent import

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