FME Version
Affects: FME Desktop and Server 2018.1 and greater
Introduction
Python 2.7 itself will be officially retired by the year 2020. Fortunately, we’ve been working for some years to transition FME from Python 2.7 to 3.x. Beginning in FME 2019, we will begin to phase out support for Python 2.7 by making it an optional component of the FME installation on Windows.
Support for Python 2.7 will be removed entirely from Windows in 2022.0 and has already been removed for Linux and macOS in FME 2021. For a detailed explanation on why this change is occurring, please see the More Information section below.Content Overview
Symptom(s)
Workbench Warning
As a part of this process, the following message dialog will appear when a workspace with a Python Compatibility setting of Python 2.7 containing user-defined Python is opened in Workbench in FME 2018.1+.
Message dialog that appears when workspace with a Python Compatibility setting of Python 2.7 containing user-defined Python is opened.
User-defined Python can occur in one or more of the following places: Startup or Shutdown Python Scripts, Scripted User Parameters, a PythonCaller transformer, or a PythonCreator transformer.
If the message dialog appears, but user-defined Python cannot be found within the workspace, look within custom transformers for PythonCaller or PythonCreator transformers. See the Editing Custom Transformers section of this custom transformer documentation for details.
Log Warning
The following warning is logged when Python 2.7 is loaded in 2018.1+. This warning may appear even if the workspace does not contain user-defined Python because FME utilizes Python in some contexts.
Warning logged when Python 2.7 is loaded. The URL in the log message will direct you to this article.
Python 2.7 will be loaded for workspaces that use Python and have a Compatibility setting of “2.7” or “2.7 or 3.4+”. In FME 2019.0+, a setting of “2.7 or 3.4+” will silently load Python 3.4+ if Python 2.7 is not installed.
Behavior in FME 2022.0+
- FME 2022.0 Workbench cannot author workspaces with a Python Compatibility setting of Python 2.7 or Esri ArcGIS Python 2.7.
- Workspaces with a Python Compatibility setting of Python 2.7 or Esri ArcGIS Python 2.7 will have their Python Compatibility changed to the latest supported Python or Esri ArcGIS Python version respectively when loaded in Workbench for FME 2022.0.
- Workspaces with a Python Compatibility setting of Python 2.7 or Esri ArcGIS Python 2.7 will not be able to run with FME 2022.0.
- Essentially any workspace containing Python 2.7 specific scripting will fail.
Solution
If the warning is logged and there is no user-defined Python in the workspace, it should be safe to simply change the Python Compatibility parameter of the workspace to 3.4+.
Otherwise, users have the following options:
1. Port all user-defined Python 2 code within the workspace to Python 3 (recommended)
- Please see this Python How To for a good resource on porting Python 2 to Python 3.
- After the port, change the workspace Python compatibility parameter to the appropriate Python 3.x and save. The warning will not appear again for this workspace.
Change the workspace Python Compatibility parameter after porting to Python 3
2. Ignore message dialog (not recommended)
- Workspaces that require Python 2.7 will continue to run in FME 2018.1.
- Starting in FME 2019, workspaces that are set to Python 2.7 will fail if Python 2.7 is not installed on Windows.
Starting in FME 2021, workspaces that are set to Python 2.7 and contain user-defined Python 2 code will fail on macOS and Linux.
Windows platform
If a port to Python 3 cannot be done and Python 2.7 is required in FME 2019+, users should uninstall/reinstall FME with the Python 2.7 component. However, it is highly recommended to move away from using Python 2.7 due to its retirement in 2020.
Starting in FME 2022, workspaces that are set to Python 2.7 and contain user-defined Python 2 code will fail on Windows.
Linux and macOS platforms
2021.0+ Update: Python 2.7 support has been removed in FME 2021. Existing workspaces with a Python Compatibility parameter of Python 2.7 and user-defined Python code will fail. There is no optional Python 2.7 install component for macOS and Linux. Please port all user-defined Python 2 code in the workspace to Python 3. Please see the resources in Solution section above on Python 3 on how to port.
For users of FME 2020.x and older versions, it is still recommended to migrate from Python 2.7 on Linux and macOS as Red Hat 8 and Ubuntu 20.04 are expected to remove Python 2.7. On macOS, Python 2.7 already has significant limitations compared to other platforms.
More Information
Python 2.7 is bundled with FME on Windows. It relies on the Visual Studio 2008 (VS2008) runtime (VC90), which is also bundled with FME. The change in FME’s Python 2.7 support is motivated by both Microsoft no longer supporting the VS2008 runtime and the retirement of Python 2.7.
As many large organizations are establishing rules that forbid the use of software that contain known security holes or is no longer supported, bundling 3rd-party libraries that violate these rules can complicate the deployment of FME.
Python 2.7 is an optional component that is not installed on default installation settings in the FME installer for Windows beginning in FME 2019 and ending in FME 2021. This change will only affect workspaces that use Python (including Python-based formats and transformers that ship with FME) and have a Python Compatibility setting of Python 2.7.
Comments
0 comments
Please sign in to leave a comment.