I encounter a problem when using a python / arcpy script in FME, from a PythonCaller.
Some arcpy instruction does not work in FME, for example :
However, in ArcGIS Desktop it works (feature class exist) :
However, in python it works (feature class exist) :
Here is the code contained in FME :
# Import system library
# Import arcpy librairy for FME
agdArcpyPath = r'C:\Program Files (x86)\ArcGIS\Desktop10.3\arcpy'
agdBinPath=r'C:\Program Files (x86)\ArcGIS\Desktop10.3\bin'
if agdBinPathnot in sys.path:
if agdArcpyPath not in sys.path:
if arcpy.Exists(fcPath): # Problem, it return False in FME
# Execute workflow
For information here is the technical background :
Has anyone ever succeeded in integrating some python/arcpy code into FME?
Do you have an idea to solve my problem?
Thank you for your help.
It might be arcpy is not loading properly.
Please see how I call arcpy in this example:
Making a subprocess ensures the Python environments are clean.
You need Data Interoperability extension installed and enabled, then you will see a Spatial ETL tool, in the advanced parameters is a Python shutdown script. My apologies for not explaining, it was an early start :-).
Sorry for the late response, I had to interrupt my project for another.
Thanks for your sample toolbox. Like this I discovered DataInteroperability extension.
But that does not solve my problem, you does not call arcpy library in PythonCaller component.
So I used SystemCaller instead of PythonCaller.
Methodology is different, but it also acceptable for my project.