Skip to main content
Solved

Run fmeobjects on linux

  • December 14, 2015
  • 3 replies
  • 31 views

Forum|alt.badge.img

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

Best answer by david_r

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

View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

david_r
Celebrity
  • Best Answer
  • December 14, 2015

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


ravenkopelman
Safer
Forum|alt.badge.img+1

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.


Forum|alt.badge.img
david_r wrote:

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. :)


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings