FME Flow: 2026.3

Using Python with FME Flow

If you run workspaces from FME Flow that reference Python, the FME Engines must know which Python interpreter to use. Workspaces built with FME Form 2016 or later tell FME which version of Python is required to run Python code through the Python Compatibility workspace parameter.

The Python interpreter that the FME Engines actually use is the one that most closely matches the Python Compatibility workspace parameter, which, by default, is FME’s latest supported version of Python 3. To change the default Python interpreter used by the FME Engines, see Changing the Python Interpreter (Windows only) (below).

Using Additional Python Modules

If you need to reference a Python module from FME Flow that is not part of the Python standard library, you can follow either of two procedures: 1) Uploading a package through the FME Flow Web User Interface; or 2) Installing a package directly into the FME Flow System Share (requires administrator privileges on Windows or root access on Linux).

Method 1: Uploading a Package Through the Web User Interface

Using this method, you can install a package to any machine with FME installed, as long as the operating system and Python version for the module match that of the FME Flow installation.

  1. Install the package:
  2. fme python -m pip install <package_name> --target <staging_folder>

  3. From the Resources page, upload the contents of <staging_folder> to Engine\Plugins\Python\python<nnn>.

Method 2: Install a Package Directly to the FME Flow System Share

This method requires administrator privileges on Windows or root access on Linux.

Note  For the default location of the FME Flow System Share, see Directory and Account Permissions.

Windows: Example command on PowerShell elevated to admin privileges

 

& "<FME_Flow_Dir>\Server\fme\fme.exe" python -m pip install <package_name> --target "<System_Share>\resources\engine\Plugins\Python\python<nnn>"

icacls "<System_Share>\resources\engine\Plugins\Python\python<nnn>\*" /reset /T /C /Q

Note   The icacls command is required. Without it, the FME Flow Engines service cannot read the package.

Linux

 

sudo sh -c 'umask 022; <FME_Flow_Dir>/Server/fme/fme python -m pip install <package_name> --target "<System_Share>/resources/engine/Plugins/Python/python<nnn>"'

Note  
  • If the umask of root is restrictive (for example 077), an FME engine user cannot import the package. The umask 022 directive prevents this.

  • If the python<nnn> folder does not exist, pip creates it with root as the owner (root:fmeflow 2755). As such, the FME Flow service cannot write to the folder, and later uploads through the Web User Interface fail. Create the folder through the Resources page before installing, or change its owner to the FME Flow service user after installing.

Changing the Python Interpreter (Windows only)

Important  Consider changing the Python interpreter only if the Python interpreter shipped with FME Flow is incompatible with third-party Python libraries required to run the Python scripts referenced in your workspaces. If you require an Esri ArcGIS Python interpreter to use ArcPy, set the Python Compatibility workspace parameter to the applicable Esri ArcGIS Python 3.x value in FME Workbench prior to uploading to FME Flow. If set properly in this case, changing the Python interpreter explicitly in FME Flow is not necessary.
Note  Beginning with FME Flow version 2019.0 on Linux, changing the Python interpreter is not supported.

Sometimes you will want to use a Python interpreter other than the ones shipped with FME Flow. In that case, you can change the interpreter through the following procedure:

Note  The Python interpreter specified by this procedure does not guarantee the FME Engines will use the interpreter for all workspaces. Instead, the FME Engines use the specified interpreter for all workspaces that have a Python Compatibility value that is compatible with the specified interpreter. If the Python Compatibility of a workspace is not compatible with the specified interpreter, the FME engines use one of their own Python interpreters that is compatible.

Open a command prompt, specifying Run as administrator, and run the following commands:

FME Flow 2018.0 and earlier

<FMEFlowDir>Server/fme/fme.exe APPLY_SETTINGS SYSTEM "Python/Use Custom Python" true

<FMEFlowDir>Server/fme/fme.exe APPLY_SETTINGS SYSTEM "Python/Python Interpreter" c:/<path_to_dll>.dll

Note  For information on how to locate Python dll's (<path_to_dll>), see Choosing a different Python Interpreter in the FME Community.

FME Flow 2018.1 and later

<FMEFlowDir>Server/fme/fme.exe APPLY_SETTINGS SYSTEM "Python/Use Custom Python 64" true

<FMEFlowDir>Server/fme/fme.exe APPLY_SETTINGS SYSTEM "Python/Python Interpreter 64" c:/<path_to_dll>.dll

<FMEFlowDir>Server/fme/fme.exe APPLY_SETTINGS SYSTEM "Python/Custom Python Home 64" c:/<path_to_python_home>

Note  <path_to_python_home> is the installation location of Python.