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.
- Install the package:
- From the Resources page, upload the contents of <staging_folder> to Engine\Plugins\Python\python<nnn>.
fme python -m pip install <package_name> --target <staging_folder>
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
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>"'
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)
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:
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
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>