# Using 3rd Party Python Library - PySerial

**URL:** <https://forum.inductiveautomation.com/t/using-3rd-party-python-library-pyserial/50130>\
**Category:** Ignition\
**Tags:** ignition80, scripting\
**Created:** [August 20, 2021, 3:16am UTC](https://forum.inductiveautomation.com/t/using-3rd-party-python-library-pyserial/50130 "2021-08-20T03:16:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdia](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdia/32/87599_2.png) [@mdia](https://forum.inductiveautomation.com/u/mdia)\
**Post date:** [August 20, 2021, 3:16am UTC](https://forum.inductiveautomation.com/t/using-3rd-party-python-library-pyserial/50130/1 "2021-08-20T03:16:03Z")

</div>

I am trying to read/write from a serial device using python’s pyserial library. I followed all the steps to install the package to jython mentioned in [this post](https://forum.inductiveautomation.com/t/procedure-for-installing-python-libraries-from-source/26022/2)  
Whenever I try to “import serial” in a the script console, I get the following error:

```auto
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\Users\mdia\.ignition\cache\gwlocalhost_8088\C0\pylib\site-packages\serial\ __init__.py", line 33, in <module>
    from serial.serialjava import Serial
  File "C:\Users\mdia\.ignition\cache\gwlocalhost_8088\C0\pylib\site-packages\serial\serialjava.py", line 38, in <module>
    comm = detect_java_comm([
  File "C:\Users\mdia\.ignition\cache\gwlocalhost_8088\C0\pylib\site-packages\serial\serialjava.py", line 32, in detect_java_comm
    raise ImportError("No Java Communications API implementation found")
ImportError: No Java Communications API implementation found

```

I now we did talk about this topic for a bit but a wanted to create a new post for it. Is there anyway to get around this error? I tried installing Java’s RxTx library and placed it in my java path folder by doing the following:

Copy rxtxParallel.dll to c:\Program Files\Java\jre1.8.0\_271\bin  
Copy rxtxSerial.dll to c:\Program Files\Java\jre1.8.0\_271\bin  
Copy RXTXcomm.jar to c:\Program Files\Java\jre1.8.0\_271\lib\ext

However, I am still getting this error. Any ideas would be greatly appreciated.

Java Version 8 Update 271 (build 1.8.0\_271-b09)  
Ignition version 8.1.3

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 20, 2021, 11:53am UTC](https://forum.inductiveautomation.com/t/using-3rd-party-python-library-pyserial/50130/2 "2021-08-20T11:53:12Z")

</div>

Ignition’s Serial Support modules use the well-maintained jSerialComm library under the hood. You should be using it, or the serial support modules themselves.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 20, 2021, 12:15pm UTC](https://forum.inductiveautomation.com/t/using-3rd-party-python-library-pyserial/50130/3 "2021-08-20T12:15:15Z")

</div>

> [@mdia](#):
>
> Copy rxtxParallel.dll to c:\Program Files\Java\jre1.8.0\_271\bin  
> Copy rxtxSerial.dll to c:\Program Files\Java\jre1.8.0\_271\bin  
> Copy RXTXcomm.jar to c:\Program Files\Java\jre1.8.0\_271\lib\ext

I don't know if this is going to end up working for you at all, but if anything you would need to copy those to Ignition's included Java runtime in `$IGNITION/lib/runtime/jre-win` and not that one.

---

<div class="post-metadata">

**Author:** ![mdia](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdia/32/87599_2.png) [@mdia](https://forum.inductiveautomation.com/u/mdia)\
**Post date:** [August 20, 2021, 1:11pm UTC](https://forum.inductiveautomation.com/t/using-3rd-party-python-library-pyserial/50130/4 "2021-08-20T13:11:08Z")

</div>

> [@pturmel](#):
>
> Ignition’s Serial Support modules use the well-maintained jSerialComm library under the hood. You should be using it, or the serial support modules themselves.

Phil, sorry forgot to mention this, but I am trying to use another 3rd party python library that uses pyserial. When the scripts in that other module call for pyserial, I get this error. That's why I am not using Ignition's serial module, unless there's a way to implement it with the 3rd party library that I am trying to use. How would I be able to use the jSerialComm library with my 3rd party python library? I found a jSerialComm executable Jar File online that downloads the following file jSerialComm-2.7.0.jar,  
I also found a jSerialComm zip folder that downloaded the following files:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/3/e3319bf3623e3f9fdc1543877f660f8633fa77e3.png)

Do I need to copy these files anywhere in the Ignition directory?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![mdia](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdia/32/87599_2.png) [@mdia](https://forum.inductiveautomation.com/u/mdia)\
**Post date:** [August 20, 2021, 1:13pm UTC](https://forum.inductiveautomation.com/t/using-3rd-party-python-library-pyserial/50130/5 "2021-08-20T13:13:47Z")

</div>

> [@Kevin.Herron](#):
>
> I don’t know if this is going to end up working for you at all, but if anything you would need to copy those to Ignition’s included Java runtime in `$IGNITION/lib/runtime/jre-win` and not that one.

Kevin, I tried copying rxtxParallel.dll and rxtxSerial.dll in C:\Program Files\Inductive Automation\Ignition\lib\runtime\jre-win\bin

but wasn't sure were to copy RXTXcomm.jar since that needs to be in the ext folder and $IGNITION/lib/runtime/jre-win/lib does not have that file. Any idea where I would need to copy that file to give this shot?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 20, 2021, 1:23pm UTC](https://forum.inductiveautomation.com/t/using-3rd-party-python-library-pyserial/50130/6 "2021-08-20T13:23:07Z")

</div>

I think you might get away with putting them all into `$IGNITION/lib/core/gateway`.

You’ll have to restart the gateway and make sure you are running your test script in the gateway scope and not, e.g. the designer script console.
