Procedure for installing python libraries from source

There’s actually a procedure you can use to use pip from within Jython to install packages, then link Ignition’s Jython lib to an-off-the-shelf Jython lib and use that…however, the article specifically calls out the twilio module as not working, because one of its dependencies, cffi, has C dependencies (IE, won’t work in Jython).

For posterity, here’s the procedure, copied verbatim from an internal document:
0) On the server, install Java 8 if you haven’t already.

  1. Download the full Jython 2.7.1 installer, and install. I installed to c:\jython2.7.1 for simplicity. Keep all other options default. Link: http://search.maven.org/remotecontent?filepath=org/python/jython-installer/2.7.1/jython-installer-2.7.1.jar
  2. Make sure JAVA_HOME points to the jre directory (tested with 8u191). If it’s not there, add the environment variable.
  3. Open a CMD prompt in admin mode. (Not PowerShell) “cd” to the /bin
  4. run “jython -m ensurepip” to install pip and setuptools
  5. Shut down Ignition if it’s already running
  6. In the CMD prompt, “cd” to the Ignition/user-lib/pylib folder
  7. Delete the “site-packages” folder
  8. Create a Junction link to the Jython site-packages directory: “mklink /J site-packages c:\jython2.7.1\Lib\site-packages”
5 Likes