Skip to main content
Solved

FME hangs at FME_BEGIN_PYTHON when using arcpy


Forum|alt.badge.img
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!

Best answer by david_r

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

 

 

David
View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

9 replies

david_r
Celebrity
  • July 9, 2015
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

Forum|alt.badge.img
  • Author
  • July 9, 2015
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 

david_r
Celebrity
  • July 10, 2015
What happens if you comment out the line starting with arcpy.CreateFileGDB_management?

 

 

Does it still hang?

 

 

David

Forum|alt.badge.img
  • Author
  • July 10, 2015
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!

david_r
Celebrity
  • July 13, 2015
Interesting, sounds more like a problem with arcpy than with FME.

 

 

Can you use arcpy within from ArcGIS Desktop?

 

 

David

Forum|alt.badge.img
  • Author
  • July 13, 2015
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!

 

 

Forum|alt.badge.img
  • Author
  • July 13, 2015
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. 

 

 

 

david_r
Celebrity
  • Best Answer
  • July 14, 2015
You might want to try reinstalling FME, just in case. If that doesn't help, consider contacting Safe support.

 

 

David

Forum|alt.badge.img
  • Author
  • July 17, 2015
You are probably right David. If I publish the workbench on FME server everything runs smoothly. Thanks for your help on this.

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