Errors FMEWorkspaceRunner Python | Errors FMEObjects Python

Liz Sanderson
Liz Sanderson
  • Updated

Symptom

A python script which imports FMEObjects and uses classes such as FMEWorkspaceRunner etc. may fail or throw an error when run outside of FME.

Possible errors include:

ImportError: No module named fmeobjects


or

fmeobjects.FMEException: FMEException: 896902


Cause

Possible causes of this problem are shown below and solutions for each cause are shown in the Resolution below:

  1. The python interpreter may not be able to find FMEObjects.
  2. The python interpreter may find an incorrect or unlicensed fme.dll
  3. Trying to use FMEWorkspaceRunner on FME Server


Resolution

1. The python interpreter may not be able to find FMEObjects.
There are a few solutions to this problem.

a) Provide the path to fmeobjects in your script. The path to fmeobjects is within your FME install directory: <FME>\fmeobjects\python27. Below is an example of the code to add to your python script:

import sys 
sys.path.append("C:\\apps\\FME 2015.0\\fmeobjects\\python27") 


b) Set the PYTHONPATH environment variable on your computer to include the path to:

fmeobjects: <FME>\fmeobjects\python27


2. The python interpreter may find an incorrect, unlinked, or unlicensed fme.dll
First, ensure your FME installation is licensed by running one of the FME applications such as FME Workbench.

This issue is most often caused by having ArcGIS installed on the same computer and using the python interpreter installed by ArcGIS. In this situation, fmeobjects may try to use a fme.dll installed by ArcGIS which is not linked to a valid FME installation. There are two possible solutions to this problem.

a) Extend FME into ArcGIS by running the FME Integration Console and clicking the Extend button next to the FME Extension for ArcGIS.

b) If you do not plan to use the FME Extension for ArcGIS and you have FME installed then you can rename the fme.dll installed in ArcGIS here:
<ArcGIS>\Desktop10.2\bin\fme.dll to something else such notused.dll. Then your python script will fall back to the correct fme.dll when using fmeobjects classes.

If you are using 64-bit FME and have Esri 64-bit Background Geoprocessing installed, the fme.dll to rename is located at: <ArcGIS>\Desktop10.2\bin64.

CAUTION: renaming the fme.dll in ArcGIS will disable the Data Interoperability Extension and the FME Extension for ArcGIS and is therefore not the recommended solution.

3. Trying to use FMEWorkspaceRunner on FME Server
An FME running within FMEServer is intended for processing FME Server jobs and cannot be used to run workspaces using the FMEWorkspaceRunner class. If you want to run a workspace programmatically within FME Server please see the FME Server REST API.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.