Solved

Run fmeobjects on linux

  • 14 December 2015
  • 3 replies
  • 8 views

Badge

So I have an FME workflow i need to run on a linux machine. I've managed to get the FME engine installed and i can run workbenches via the command line, however when i try to run a python script to run my workbench i get the following error:

ImportError: libfmeobj.so: cannot open shared object file: No such file or directory

Does anyone have any experience running FME workspaces via python on ubuntu?

I've copied my python script from a previous post from Ken's. Although i have a small amendment to check the OS which the script is being run on:

import sys, os, platform
# Set variables based on operating system:
operating_system = platform.system()
if operating_system == "Windows":
    sys.path.append("C:\\Program Files\\FME\\fmeobjects\\python27")
    directory = "E:\FME_Workbenches\PythonTesting"
else:
    sys.path.append("/opt/fme/fmeobjects/python27")
    directory = "/opt/PythonTesting/"
import fmeobjects
#initiate FMEWorkspaceRunner Class
runner = fmeobjects.FMEWorkspaceRunner()
#Full path to Workspace, example comes from the FME 2014 Training Full Dataset
workspace = directory + "\PythonShutdownScript.fmw"
print(workspace)

The above works fine on a windows machine...not so much on ubuntu...am i missing files?

Cheers

Hugh

icon

Best answer by david_r 14 December 2015, 09:18

View original

3 replies

Userlevel 4

Hi

Remember that by default, the fmeobjects module is only available within the Python interpreter that's embedded into (installed within) FME. On a Linux system, you will typically have at least one other Pythoner interpreter installed, which is probably the one you're invoking in your case.

The best cross-platform solution is probably not to use fmeobjects to start a workspace outside of FME, but to start it as a regular process, passing the published parameters on the command line. There are a lot of tips here.

David

Badge

libfmeobj.so lives in /opt/fme/fmecore.  You may need to

export LD_LIBRARY_PATH=/opt/fme/fmecore:$LD_LIBRARY_PATH

before you run your Python script.

Badge

Hi

Remember that by default, the fmeobjects module is only available within the Python interpreter that's embedded into (installed within) FME. On a Linux system, you will typically have at least one other Pythoner interpreter installed, which is probably the one you're invoking in your case.

The best cross-platform solution is probably not to use fmeobjects to start a workspace outside of FME, but to start it as a regular process, passing the published parameters on the command line. There are a lot of tips here.

David

Thanks david...i'll have a look into this. :)

Reply