Python Interpreter

This parameter specifies the level of compatibility your workspace has with different versions of the Python programming language. Python 3.0 introduced significant changes that are not backward compatible with Python 2.x. For more information about these differences, see https://wiki.python.org/moin/Python2orPython3.

FME uses this parameter to choose a Python interpreter, using the following order of selection:

  1. The interpreter selected in Tools > FME Options > Translation > Custom Python Interpreter, if it is either compatible or potentially compatible with the version specified. If potentially compatible, a warning is logged.
  2. The highest version found in the PATH environment variable, or bundled with FME, that is compatible with the version specified.
  3. The highest version found in the PATH environment variable, or bundled with FME, that is potentially compatible with the version specified. In this case, a warning is always logged.

This choice is made for each workspace at the time it is created. You can update this choice in the Custom Python Interpreter setting in Tools > FME Options > Translation > Custom Python Interpreter.

Compatibility Levels

  • Compatible: Python version x.y is compatible with w.z if x == w and y >= z
  • Potentially compatible: Python version x.y is potentially compatible to version w.z if x == w and y < z
  • Incompatible: Python version x.y is incompatible with version w.z if x != w

Specifying a Compatibility

2.7

FME Workbench saves the choice of Python 2.7 in the workspace, and FME selects the Python 2.7 interpreter bundled with FME (Windows), or the Python 2.7 interpreter installed on your system (Linux and Mac OS X).

3.4+

FME Workbench saves the choice of Python 3.4 in the workspace, and FME selects a Python interpreter using the order of selection described above.

2.7 or 3.4+

FME selects a Python interpreter using the order of selection described above, and uses the first available interpreter of any version. Use this setting only if you know you are writing Python code that is compatible with any version of Python supported by FME.

Scenarios

To run a Python-enabled workspace as optimally as possible on FME Desktop

Leave Python Interpreter at its default setting.

To use a specific Python interpreter, such as the ArcGIS interpreter for ArcPy, or a system-specific interpreter with custom modules

Leave Python Interpreter at its default setting, and specify the interpreter in Tools > FME Options > Translation > Custom Python Interpreter.

To run Python code that uses features from a specific version of Python

Set Python Interpreter to the appropriate version of Python.

To ensure the greatest compatibility with other FME Desktop users and/or FME Server.

Leave Python Interpreter at its default setting.

To run Python code that you know is compatible with both Python 2.7 and 3.x, and ensure the greatest compatibility with other FME Desktop users and/or FME Server

Set Python Interpreter to 2.7 or 3.4+.