Skip to main content

I have a need to access some advanced graph algorithms in the RAPIDS (rapids.ai) package from a PythonCaller, which is normally installed as a Conda environment.  I have found a few references on selecting the Conda-environment-specific Python interpreter, but unfortunately, they all assume we are running under Windows.  We are running Ubuntu Linux, and the Linux installation of FME Form (as well as the macOS installation) doesn’t support custom interpreters.

Any ideas on how I can get around this?  I’ve previously managed to install pip packages into the standard FME interpreter environment with no issues, but it’s very difficult to successfully install RAPIDS using pip due to its many binary dependencies.

Hey @User17042260974539197207 

There are a couple of ways to work around this:

  1. Using PythonCaller you can use the built-in Python subprocess module to make command line calls. This would allow you to activate a Conda environment and run an external Python script from the PythonCaller transformer. However, you may need to serialize the FME Feature data to pass it out of the PythonCaller. 
  2. SystemCaller also works to spawn the process to call the command line.

Alternatively to serializing data manually through Python, you can check out this article which explains how to write data with the FeatureWriter, execute a command on the data, then read the data with the FeatureReader to get the features back into the translation. 

Hope this helps!

Emma


Thanks, Emma!  That makes sense as an option.  But I’ve found a way to install the needed libraries using pip instead.  When I first tried it, the pip installation failed.  But I managed to get it working so I could use the standard procedure for adding Python packages to the FME Python runtime environment.


Reply