# How to use python library(openpyxl)in ignition 8 scripting

**URL:** <https://forum.inductiveautomation.com/t/how-to-use-python-library-openpyxl-in-ignition-8-scripting/36603>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [July 11, 2020, 1:40pm UTC](https://forum.inductiveautomation.com/t/how-to-use-python-library-openpyxl-in-ignition-8-scripting/36603 "2020-07-11T13:40:44Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![yifeiliu08](https://avatars.discourse-cdn.com/v4/letter/y/bbe5ce/32.png) [@yifeiliu08](https://forum.inductiveautomation.com/u/yifeiliu08)\
**Post date:** [July 11, 2020, 1:40pm UTC](https://forum.inductiveautomation.com/t/how-to-use-python-library-openpyxl-in-ignition-8-scripting/36603/1 "2020-07-11T13:40:44Z")

</div>

I currently study the python 3.7 that have a function use excel, so i need first pip install openpyxl this module in my computer

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/7/f7dc81a230cc06e5f396f889d9a6cea2f3f925f2.png)  
in the program i can import the module by import openpyxl  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/6/262bd388cbc96a3d208f02b059307d4279cc7ef0.png)  
my question , if in ignition 8, if i want to use the python library (for example the openpyxl), how to set the module then i can directly import openpyxl in my scripting  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/1/e1cc81b06a6b00bfaab4a50f32f9b9613da00ef2.png)

---

<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:** [July 11, 2020, 1:49pm UTC](https://forum.inductiveautomation.com/t/how-to-use-python-library-openpyxl-in-ignition-8-scripting/36603/2 "2020-07-11T13:49:47Z")

</div>

You cannot. Jython 2.7 is significantly different from Python 3.7.

---

<div class="post-metadata">

**Author:** ![yifeiliu08](https://avatars.discourse-cdn.com/v4/letter/y/bbe5ce/32.png) [@yifeiliu08](https://forum.inductiveautomation.com/u/yifeiliu08)\
**Post date:** [July 11, 2020, 2:01pm UTC](https://forum.inductiveautomation.com/t/how-to-use-python-library-openpyxl-in-ignition-8-scripting/36603/3 "2020-07-11T14:01:08Z")

</div>

python’s default library is not so much, but python have a big advantage is he can import a lot of library  
my question is if Jython 2.7 have the same function like python, import other library, if yes, can you introduce some information about how to do in that way

---

<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:** [July 11, 2020, 2:13pm UTC](https://forum.inductiveautomation.com/t/how-to-use-python-library-openpyxl-in-ignition-8-scripting/36603/4 "2020-07-11T14:13:46Z")

</div>

I've just checked the requirements for openpyxl--there are transitive (optional?) dependencies on CPython native DLLs. Those can't be made to work in a JVM. You'll have to retool your scripts to use a java library for document manipulation. Apache POI is a popular choice, and happens to be part of Kymera's [Office Document Module](https://inductiveautomation.com/moduleshowcase/module/kymera-systems-inc-kymera-office-document-module).

There are [numerous discussions on this forum](http://forum.inductiveautomation.com/search?q=apache%20poi) describing the use of Apache POI, including commentary on its use as an alternative to openpyxl.

There's also a report of partial success with an older version of openpyxl. Might want to try that:

> [@Using Openpyxl 3rd party python library](http://forum.inductiveautomation.com/t/using-openpyxl-3rd-party-python-library/32785):
>
> Hello, I’m trying to get openpyxl to work with Jython. I’ve followed steps from: [[Procedure for installing python libraries from source](http://forum.inductiveautomation.com/t/procedure-for-installing-python-libraries-from-source/26022)]([http://Installing](http://Installing) 3rd party python libraries) and have used pip to install openpyxl using jython2.7.1. I can even see it in Ignition when I do help(“modules”). When I try to import openpyxl I get this error, even though I know that datetime functions work… there is a datetime.py in that cache folder… maybe that’s messing it up. Any luck with this? thanks …

---

<div class="post-metadata">

**Author:** ![yifeiliu08](https://avatars.discourse-cdn.com/v4/letter/y/bbe5ce/32.png) [@yifeiliu08](https://forum.inductiveautomation.com/u/yifeiliu08)\
**Post date:** [July 11, 2020, 2:28pm UTC](https://forum.inductiveautomation.com/t/how-to-use-python-library-openpyxl-in-ignition-8-scripting/36603/5 "2020-07-11T14:28:53Z")

</div>

thanks pturmel’s input, there really many information to read, i will use time to understand old discussion  
i have downlad the kymera’s office driver want to have a trial run  
but after i install , if i open the designer, it will report the fault

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/b/8b789746bfa257b49477ed2539fb2cce0490bf58.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/8/a8c2ffb19c789cc796040beed39b8074717c618d.png)  
this is the first time i try to use ignition’s 3rd party module, i don’t know this module can be directly use or need some api to link  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/f/7f3922b0622c47052dd8ee1dd397ece90a506bfd.png)

---

<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:** [July 11, 2020, 2:46pm UTC](https://forum.inductiveautomation.com/t/how-to-use-python-library-openpyxl-in-ignition-8-scripting/36603/6 "2020-07-11T14:46:36Z")

</div>

Haven’t seen that problem. You’ll probably need help from Kymera’s support.

---

<div class="post-metadata">

**Author:** ![yifeiliu08](https://avatars.discourse-cdn.com/v4/letter/y/bbe5ce/32.png) [@yifeiliu08](https://forum.inductiveautomation.com/u/yifeiliu08)\
**Post date:** [July 11, 2020, 2:53pm UTC](https://forum.inductiveautomation.com/t/how-to-use-python-library-openpyxl-in-ignition-8-scripting/36603/7 "2020-07-11T14:53:31Z")

</div>

i will test them when my plant shut down , because this module make all of my client crash, a big surprise 😀

---

<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:** [July 12, 2020, 12:03am UTC](https://forum.inductiveautomation.com/t/how-to-use-python-library-openpyxl-in-ignition-8-scripting/36603/8 "2020-07-12T00:03:09Z")

</div>

Wait! Your are playing around with a production system?

Don’t do that. Set up an isolated VM with the same stuff as your production system and use that. In trial mode.

---

<div class="post-metadata">

**Author:** ![drojas](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/drojas/32/3403_2.png) [@drojas](https://forum.inductiveautomation.com/u/drojas)\
**Post date:** [July 12, 2020, 4:36pm UTC](https://forum.inductiveautomation.com/t/how-to-use-python-library-openpyxl-in-ignition-8-scripting/36603/9 "2020-07-12T16:36:47Z")

</div>

This happened to me too. A reboot of the computer fixed it. Since you are in production, I would schedule some downtime to perform a restart of Ignition or the entire PC.

---

<div class="post-metadata">

**Author:** ![yifeiliu08](https://avatars.discourse-cdn.com/v4/letter/y/bbe5ce/32.png) [@yifeiliu08](https://forum.inductiveautomation.com/u/yifeiliu08)\
**Post date:** [July 13, 2020, 8:11am UTC](https://forum.inductiveautomation.com/t/how-to-use-python-library-openpyxl-in-ignition-8-scripting/36603/10 "2020-07-13T08:11:41Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/f/8f500d885d19aafce8786f9da4588218561ab834.png)  
i install on a trial system, and restart that pc, but still have found that fault

---

<div class="post-metadata">

**Author:** ![Eden.Mar](https://avatars.discourse-cdn.com/v4/letter/e/35a633/32.png) [@Eden.Mar](https://forum.inductiveautomation.com/u/Eden.Mar)\
**Post date:** [July 15, 2020, 5:31pm UTC](https://forum.inductiveautomation.com/t/how-to-use-python-library-openpyxl-in-ignition-8-scripting/36603/11 "2020-07-15T17:31:12Z")

</div>

Hi yifeiliu08,

Thank you for your interest in our module. If you would forward a screenshot of the full stack trace, and the build number of the module to [support@kymerasystems.com](mailto:support@kymerasystems.com), we’d be happy to further assist you.
