Skip to main content
Question

My Python script that uses arcpy no longer runs in FME 2016.1

  • February 10, 2017
  • 1 reply
  • 4 views

fmelizard
Safer
Forum|alt.badge.img+19

I created a workspace using FME 2016.0 or older that contains a python script that uses arcpy to connect to an SDE Geodatabase. But now if I try to run that same workspace using FME 2016.1, the script is either throwing an error or not working as expected. I can run that same python script with Python outside of FME without a problem.

1 reply

laurawatsafe
Safer
Forum|alt.badge.img+11

This problem has been fixed in FME 2017, so those scripts should all work fine when run using the newest version of FME.

In FME 2016.1, a change was made that causes FME to move it's own python library directories to the front of the python path. This can cause trouble with running python scripts in some scenarios, specifically when using arcpy to connect to an SDE Geodatabase. To work around this problem, add the following lines to your Python script before your import arcpy statement: 

import sys  sys.path.append(sys.path.pop(0))  sys.path.append(sys.path.pop(0))

This will move the FME python paths to the end of the path instead.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings