Skip to main content
Solved

No module named arcpy

  • June 26, 2014
  • 2 replies
  • 361 views

philippeb
Enthusiast
Forum|alt.badge.img+22
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
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, 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+22
  • 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...