Import pandas for scripting

Hi,

I would like to use pandas libs in my ignition scripts.

Using pip command I downloaded pandas and its dependencies and all requirements are satisfied (for Python 2.7). Using python script (outside ignition) i can use pandas’ functions.
Coping all libs in Ignition (/usr/local/ignition/user-lib/pylib) and using it in a gateway script the following error is prompt: “ImportError: Missing required dependencies [‘numpy’]” but it exists.
If I try using only “numpy” a new error is prompt:

Traceback (most recent call last):
File “”, line 1, in
File “/Users/mirkoboggian/.ignition/cache/gwlocalhost_8088/C0/pylib/numpy/init.py”, line 142, in
from . import core
File “/Users/mirkoboggian/.ignition/cache/gwlocalhost_8088/C0/pylib/numpy/core/init.py”, line 71, in
raise ImportError(msg)
ImportError:

IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!

Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
Here is how to proceed:

  • If you’re working with a numpy git repository, try git clean -xdf
    (removes all files not under version control) and rebuild numpy.
  • If you are simply trying to use the numpy version that you have installed:
    your installation is broken - please reinstall numpy.
  • If you have already reinstalled and that did not fix the problem, then:
    1. Check that you are using the Python you expect (you’re using /Users/mirkoboggian/.ignition/cache/resources/platform/jython-2.7.1-ia5.jar/000000001498F8CC/bin/jython),
      and that you have no directories in your PATH or PYTHONPATH that can
      interfere with the Python and numpy versions you’re trying to use.

    2. If (1) looks fine, you can open a new issue at
      https://github.com/numpy/numpy/issues. Please include details on:

      • how you installed Python
      • how you installed numpy
      • your operating system
      • whether or not you have multiple versions of Python installed
      • if you built from source, your compiler versions and ideally a build log

      Note: this error has many possible causes, so please don’t comment on
      an existing issue about this - open a new one instead.

Original error was: No module named _multiarray_umath

Can you help me?

1 Like

I’m sorry to show you this, but since Ignition uses Jython and not CPython, pandas cannot be used. More details in this link

EDIT:
You know what, I may stand corrected here. There is a previous post about this where they discuss JYNI and I think that’s a potential solution here. How to import the pandas library into ignition?

2 Likes

Well, I haven’t seen any success reports here on the forum, so I wouldn’t hold my breath. JyNI hasn’t had any dev work in two years.

2 Likes