FME Version
Considerations
A Python script that imports FMEObjects and uses classes such as FMEWorkspaceRunner may fail or throw an error when run outside of FME.
Common error messages include:
ImportError: No module named fmeobjects
fmeobjects.FMEException: FMEException: 896902
Why This Happens
Possible reasons for these errors include:
- The Python interpreter cannot find FMEObjects.
- The Python interpreter finds an incorrect or unlicensed fme.dll.
- FMEWorkspaceRunner is being used on FME Flow, which is not supported.
How to Resolve It
1. Ensure Python Can Find FMEObjects
If Python cannot locate FMEObjects, try one of these solutions:
Manually add the FMEObjects path in your script:
Add the following code to your Python script, replacing the FME installation path as needed:
import sys sys.path.append("C:\\apps\\FME 2025.0\\fmeobjects\\python37")
Set the PYTHONPATH environment variable
Add the FMEObjects path to your system’s PYTHONPATH:
fmeobjects: <FME>\fmeobjects\python37
2. Ensure the Correct fme.dll is Used
If Python finds an incorrect, unlinked, or unlicensed fme.dll, FMEObjects may not work.
- Verify your FME installation is licensed
- Run FME Workbench or another FME application to confirm licensing.
- Check for conflicts with ArcGIS
- If ArcGIS is installed, its version of fme.dll may interfere with FMEObjects.
3. Do Not Use FMEWorkspaceRunner on FME Flow
FME Flow does not support running workspaces using FMEWorkspaceRunner.
Use the FME Flow REST API or FME Flow Automations to run workspaces programmatically.
Comments
0 comments
Please sign in to leave a comment.