Skip to main content
Solved

No module named arcpy


philippeb
Enthusiast
Forum|alt.badge.img+20
Hi,

 

 

I have FME 2014 SP1 (32 bits) and ArcGIS 10.2 (32 bits) installed on a Windows7 64 bits.

 

 

I have the following code that I am trying to read into the Shutdown Python Script : 

 

 

 import sys import arcpy output_location = "\\\\MYSERVER\\MYGDB.gdb" arcpy.CreateRelationshipClass_management(output_location+"\\DATASET\\LAYER", output_location+"\\TABLE", output_location+"\\DATASET\\rRelation""SIMPLE""TABLE""LAYER""NONE""ONE_TO_MANY""NONE""FKEY""PKEY")
 My problem is that I get this error : Python Exception <ImportError>: No module named arcpy

 

 

I tried to add environment variables in PYTHON and Path as described here : http://fmepedia.safe.com/articles/Samples_and_Demos/Using-a-Python-Startup-Shutdown-Script-to-Perform-Geoprocessing-with-Arcpy#heading_toc_j_5

 

 

I tried several solutions from here : http://stackoverflow.com/questions/3701646/how-to-add-to-the-pythonpath-in-windows-7/4855685#4855685

 

 

I just can't find the way to make this working in FME. My script is working perfectly in ArcGIS.

 

 

Thank you! 

Best answer by david_r

Hi,

 

 

the problem is that FME is using its own Python interpreter and not the one installed with ArcGIS. You will have to set the FME Python interpreter to the one installed with ArcGIS, as outlined here (http://fmepedia.safe.com/articles/How_To/Choosing-a-different-Python-Interpreter-installation).

 

 

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.

2 replies

david_r
Celebrity
  • Best Answer
  • June 27, 2014
Hi,

 

 

the problem is that FME is using its own Python interpreter and not the one installed with ArcGIS. You will have to set the FME Python interpreter to the one installed with ArcGIS, as outlined here (http://fmepedia.safe.com/articles/How_To/Choosing-a-different-Python-Interpreter-installation).

 

 

David

philippeb
Enthusiast
Forum|alt.badge.img+20
  • Author
  • Enthusiast
  • June 27, 2014
WOW thanks a lot!! It is working perfectly. My morning starts great because of you.

 

 

Safe should update the documentation from the first link I put on my post though...

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