# Python 3 support for pymavlink

**URL:** <https://discuss.bluerobotics.com/t/python-3-support-for-pymavlink/2612>\
**Category:** Blue Robotics Software\
**Created:** [May 8, 2018, 2:59pm UTC](https://discuss.bluerobotics.com/t/python-3-support-for-pymavlink/2612 "2018-05-08T14:59:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bradnull](https://avatars.discourse-cdn.com/v4/letter/b/c2a13f/32.png) [@bradnull](https://discuss.bluerobotics.com/u/bradnull)\
**Post date:** [May 8, 2018, 2:59pm UTC](https://discuss.bluerobotics.com/t/python-3-support-for-pymavlink/2612/1 "2018-05-08T14:59:35Z")

</div>

I have some image processing code that will only run in Python 3 that I need to use with our vehicle. We have written some RC controller code that works fine in Python 2.7, but not in Python 3.

I am using pymavlink and specifically `mavuitl.rc_channels_override_send()` to control the motors. Running the code in Python 2 moves the motors as expected, but using the exact same code in Python 3 I get no response from the motors and no error messages in the terminal. I have a virtual environment setup, and there do not appear to be any errors during installation of pymavlink or other dependencies. `pip freeze` shows the following after installation for both Python 2 and 3:

> future==0.16.0  
> lxml==4.2.1  
> pymavlink==2.2.8  
> pyserial==3.4

Any help is much appreciated! Thanks!

---

<div class="post-metadata">

**Author:** ![bradnull](https://avatars.discourse-cdn.com/v4/letter/b/c2a13f/32.png) [@bradnull](https://discuss.bluerobotics.com/u/bradnull)\
**Post date:** [May 8, 2018, 3:32pm UTC](https://discuss.bluerobotics.com/t/python-3-support-for-pymavlink/2612/2 "2018-05-08T15:32:39Z")

</div>

Looks like I have answered my own question, but downloading [mavlink](https://github.com/mavlink/mavlink) and building pymavlink from scratch appeared to solve the problem. It still claims to be version 2.2.8, but now it works properly with python 3. If anyone has an idea on how to get the PyPI python 3 version of pymavlink to work, it would be appreciated. For now, building from scratch appears to be a good stopgap.

---

<div class="post-metadata">

**Author:** ![patrickelectric](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/patrickelectric/32/2162_2.png) [@patrickelectric](https://discuss.bluerobotics.com/u/patrickelectric)\
**Post date:** [May 8, 2018, 3:38pm UTC](https://discuss.bluerobotics.com/t/python-3-support-for-pymavlink/2612/3 "2018-05-08T15:38:28Z")

</div>

I’m glad that you figured it out 🙂

> [@bradnull](#):
>
> If anyone has an idea on how to get the PyPI python 3 version of pymavlink to work, it would be appreciated. For now, building from scratch appears to be a good stopgap.

Are you using pip from python3 ?

```sh
pip --version
pip 9.0.1 from /usr/lib/python3.6/site-packages (python 3.6)

```

```sh
pip2 --version
pip 9.0.1 from /usr/lib/python2.7/site-packages (python 2.7)

```

You can install pymavlink with any version of pip 🙂

---

<div class="post-metadata">

**Author:** ![bradnull](https://avatars.discourse-cdn.com/v4/letter/b/c2a13f/32.png) [@bradnull](https://discuss.bluerobotics.com/u/bradnull)\
**Post date:** [May 8, 2018, 3:51pm UTC](https://discuss.bluerobotics.com/t/python-3-support-for-pymavlink/2612/4 "2018-05-08T15:51:12Z")

</div>

I’m on a Raspberry Pi, so I’m limited to Python 3.4, but yes my pip is the version for python3.4 afaik.

```auto
(venv) $ pip3 --version
pip 10.0.1 from /home/pi/projects/controller/venv/lib/python3.4/site-packages/pip (python 3.4)

```
