PythonCaller Failed 'FeatureProcessor' error with ArcPy

  • 2 April 2024
  • 3 replies

Userlevel 1
Badge +10

Hi All,

Quick question in regards FME & ArcPy: I have been able to create a Python script that overwrites a ‘tree_ID’ field on AGOL based on the sum count of the three geometries (point, line and polygon). Basically the script does the following calculation and assigns the IDs, example below:

Point = 3 features

Line = 2 features

Polygon = 2 features

TOTAL = 7 features 

ID to update on AGOL 1,2,3,4,5,6 and 7

The python works fine as the AGOL feature hosted layers have been updated with the new ‘tree_ID’ but the PythonCaller stops with the following error: ‘PythonFactory failed to load python symbol `FeatureProcessor'. An outdated FME packaged transformer may be in use. Please check Tools > FME Options > FME Packages to confirm that all FME Packages are up to date’

I can always run it on Pro but wanted to integrate it using PythonCaller as part of my workflow runs on FME,

Any idea why I’m getting that error?

PD: Python script attached.


Best answer by nielsgerrits 2 April 2024, 16:37

View original

3 replies

Userlevel 6
Badge +32

I’m by no means a specialist in this field, but you will get this error as long as you do not put your code within the class “FeatureProcessor” as the sample is created when opening a new, default PythonCaller.

Userlevel 1
Badge +10

Thanks @nielsgerrits your guidance has helped a lot! Issue has been fixed now after adding the class “FeatureProcessor” and define ‘__init__’ and ‘input’.

I have attached the final Python codes for completeness in the case someone else faces the same issue in the future!

Userlevel 6
Badge +32

Cheers :)