Hi @Lili_Marleen,
Pymavlink should work on both Python 2 and Python 3. pip3
installs libraries to Python 3, so understandably installing a library to Python 3 (python3
) and then trying to import it into a Python 2 (python
) session won’t work.
That’s not a requirement, but in the interests of being able to use the most recent Python features it may be something you want to do. I believe all of our current Pymavlink examples (on the page you linked to) should be compatible with Python 2.7 and above, but our Companion Beta software uses Python 3.9, and new/advanced examples we provide may not maintain compatibility with older versions of Python.
Personally I quite like many of the new language features, so my own examples (like this gist) tend to assume Python 3.8 or higher by default. That said, we’re still able to help with questions/testing things with earlier versions of Python as necessary, so if for some reason you need to stay on an older system you should still be able to get support
Out of interest, is there a particular reason you’re using Ubuntu 18.04 instead of 20.04 (the latest stable, which comes with Python 3.8 by default)?