Add python modules

Hello all,

Is it possible to add python modules ? i need to add modules to create a project and i don’t find the way for adding this.

Thanks in advance

You can import pure Python libraries or Jython libraries, but you can’t import a libraries with C dependencies. You can add them into the ignition directory under C:\Program Files\Inductive Automation\Ignition\user-lib\pylib

2 Likes

There are two main ways around this. Simplest is to use system.util.execute('python', 'some/path/myScript.py'). There are ways to capture the output of this though I cannot find the link currently.

Alternatively, if you don’t mind a little web development you can set up a simple flask server that you trigger the script with by doing a POST or similar request to it from Ignition. Do all your CPython related stuff in the flask API endpoint, and return a json of results to the Ignition request.

1 Like

Thanks for your reply, i thought about this solution (system.util.execute…) i will try

In case you need the output from the system.util.execute method