# Using Pyserial with MWorks Python

**URL:** <https://mworks.discourse.group/t/using-pyserial-with-mworks-python/83>\
**Category:** Support\
**Created:** [February 8, 2022, 9:11pm UTC](https://mworks.discourse.group/t/using-pyserial-with-mworks-python/83 "2022-02-08T21:11:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [February 8, 2022, 9:11pm UTC](https://mworks.discourse.group/t/using-pyserial-with-mworks-python/83/1 "2022-02-08T21:11:03Z")

</div>

Hi Chris,

As we mentioned in our meeting last week, Margaret is working on trying to incorporate an Arduino device for use with MWorks. Our primary issue at the moment is that we’ve not been able to use the pyserial plugin for Python, despite downloading Python 3.7, and I’ve been a bit confused as to how we can install new 3rd-party plugins to work with MWorks’ embedded version of Python. I’ve installed pyserial with Anaconda, but MWorks continues to report that it can’t find the serial module - do you have any suggestions?

Thank you for your help!

Best,

Jack

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [February 8, 2022, 9:28pm UTC](https://mworks.discourse.group/t/using-pyserial-with-mworks-python/83/2 "2022-02-08T21:28:28Z")

</div>

Hi Jack,

The current nightly build embeds Python 3.9, not 3.7. If you install pyserial using a Python 3.9 version of Anaconda, then all that’s left to do is tell MWorks’ bundled Python where to find it. You do this by adding the installation directory to [sys.path](https://docs.python.org/3/library/sys.html#sys.path). At the beginning of your Python script, include something like this:

```auto
import sys 
anaconda_path = '/Users/jack/anaconda/envs/py39/lib/python3.9/site-packages'
if anaconda_path not in sys.path:
    sys.path.insert(0, anaconda_path)

import serial

```

Note that I haven’t used Anaconda in many years, and your `site-packages` path may look different. But that’s the only part that should need to change.

Cheers,  
Chris

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [July 19, 2022, 6:22pm UTC](https://mworks.discourse.group/t/using-pyserial-with-mworks-python/83/3 "2022-07-19T18:22:33Z")

</div>

Closed on July 19, 2022, 6:22pm UTC


