Skip to main content
Question

Custom Python module locations in FME Server

  • October 1, 2019
  • 3 replies
  • 204 views

Forum|alt.badge.img

Hi. I have a workspace that uses custom python module inside a python caller. I'm trying to run the workspace via FME server. I've set my python compatibility to 3.5+ and uploaded the python module that i'm using to the servers engine\\plugins\\python\\python35 folder according to the FME instructions here:

https://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Workbench/Workbench/Importing_Custom_Python_Modules_FMEServer.htm

However, the workspace yet can't locate the module and i'm still getting the error "no module xx found"

What i'm doing wrong? Where should i copy the module? I can't use pip install, because the server machine does not have internet access.

I've managed to work this around somehow before, but now the server has been updated and the module is gone.

So what actually is the correct path to the python that FME server is using? Is there a way to check it out?

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, 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
  • 8394 replies
  • October 1, 2019

The PYTHONPATH should be in the FME job log, if I'm not mistaken.

If not, you can easily check it your self:

  1. Create a new, empty workspace with a Creator -> PythonCaller
  2. In the PythonCaller, use the following code
import sys
import fmeobjects
 
def print_python_path(feature):
    for p in sys.path:
        fmeobjects.FMELogFile().logMessageString('PYTHONPATH: ' + p)

This will output several lines in the FME job log that states where the FME Python interpreter is looking for modules when it encounters an import statement.

 


Forum|alt.badge.img
  • Author
  • 11 replies
  • October 1, 2019

The PYTHONPATH should be in the FME job log, if I'm not mistaken.

If not, you can easily check it your self:

  1. Create a new, empty workspace with a Creator -> PythonCaller
  2. In the PythonCaller, use the following code
import sys
import fmeobjects
 
def print_python_path(feature):
    for p in sys.path:
        fmeobjects.FMELogFile().logMessageString('PYTHONPATH: ' + p)

This will output several lines in the FME job log that states where the FME Python interpreter is looking for modules when it encounters an import statement.

 

Thank you, i was able to locate the correct path where i should add the python module, and it's working now! The log told me what python interpreter it is using and from where (PYTHONHOME path), and after copying the module to that path, everything worked.

However i'm still confused that the FME instructions i mentioned above is not working.

 


david_r
Celebrity
  • 8394 replies
  • October 1, 2019

Thank you, i was able to locate the correct path where i should add the python module, and it's working now! The log told me what python interpreter it is using and from where (PYTHONHOME path), and after copying the module to that path, everything worked.

However i'm still confused that the FME instructions i mentioned above is not working.

 

Unfortunately sometimes the software changes faster than the documentation. If you think it's an error, please consider contacting Safe and let them know. They're fairly quick to fix these things.