Skip to main content
I have the following python script as the Startup Python Script parameter:  
 import arcpy  out_folder_path = "C:/output"  out_name = "fGDB.gdb"  arcpy.CreateFileGDB_management(out_folder_path, out_name) print("Job Finished") 
 

 

When running the translation, FME hangs indefinitely at this point :  
 Using user-specified Python interpreter from C:\WINDOWS\system32\python27.dll  Python version 2.7 successfully loaded  FME_BEGIN_PYTHON: evaluating python script from string...
 If I remove the arcpy CreateFileGDB_management function but leave the arcpy import, everything is fine and I see the "Job Finished" string in the console. I tried just setting up arcpy.env.workspace instead of creating a new fgdb, but it hangs there as well.  

 

 

Anyone knows what's going on? Thanks a lot!
Hi

 

 

Could it be that you're running a 64-bit version of Windows? If so, you're using the wrong python27.dll, you should be using the one in "C:\\Windows\\SysWOW64\\python27.dll" in stead.

 

 

David
Thanks David.

 

 

I tried that SysWOW64\\python27.dll as well with the same result. I was following these guidelines: https://knowledge.safe.com/articles/How_To/Choosing-a-different-Python-Interpreter-installation

 

 

When unckecking Use Custom Python Interpreter and adding the right paths in the environment variables, I'm getting an Unable to import arcpy module error:

 

https://knowledge.safe.com/articles/Samples_and_Demos/Using-a-Python-Startup-Shutdown-Script-to-Perform-Geoprocessing-with-Arcpy 
What happens if you comment out the line starting with arcpy.CreateFileGDB_management?

 

 

Does it still hang?

 

 

David
If I comment out arcpy.CreateFileGDB_management and leave import arcpy, it goes through without any problem. Any arcpy command, even setting up arcpy.env.workspace, will make FME hang. -Thanks!
Interesting, sounds more like a problem with arcpy than with FME.

 

 

Can you use arcpy within from ArcGIS Desktop?

 

 

David
Yes, I can start ArcGIS 10.1 and launch some arcpy commands like creating a new file gdb. It's working from

 

 

- the Python console inside ArcGIS Desktop 10.1

 

- ArcToolbox in ArcGIS Desktop 10.1

 

- the windows command prompt :  
 C:\python27\ArcGIS10.1>python.exe C:\Users\xxxx\Downloads\test\test.py test.py import arcpy arcpy.CreateFileGDB_management("C:/Users/xxxxx/Downloads/test","test3","CURRENT")
 Otherwise, I'm running FME Desktop 2014 SP4 Win32.  

 

 

Thanks David, much appreciated!

 

 
Another clue : FME still hangs when running this starting Python script :  
 import subprocess subprocess.call("C:/python27/ArcGIS10.1/python.exe C:/Users/xxxx/Downloads/test/test.py")
 When running : 
 C:/python27/ArcGIS10.1/python.exe C:/Users/xxxx/Downloads/test/test.py
 from the Windows Command Prompt, it works perfectly. 

 

 

 
You might want to try reinstalling FME, just in case. If that doesn't help, consider contacting Safe support.

 

 

David
You are probably right David. If I publish the workbench on FME server everything runs smoothly. Thanks for your help on this.

Reply