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

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


in the program i can import the module by import openpyxl
image
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

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

1 Like

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

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.

There are numerous discussions on this forum 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:

2 Likes

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



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

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

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

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.

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.


i install on a trial system, and restart that pc, but still have found that fault

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, we’d be happy to further assist you.