Tell me more ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm trying to use eclipse with PyDev to program in python. In Windows 7 x64, I've added a PATH environmental variable (PATH C:\Python26\ArcGIS10.0\python.exe;) and what I thought were the relevant folders to PYTHONPATH (C:\Dropbox\CODE\Python\; C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy)

alt text

However, when I type the command:

import arcpy

in eclipse I get an error message. However, when I try importing ArcPy via IDLE I have no problems. Is there some way that I should be including arcpy in the build path that I am missing?

share|improve this question

2 Answers

up vote 9 down vote accepted

You need to add %ARCGISINSTALLDIR%\bin and %ARCGISINSALLDIR%\arcpy to your paths as well.

share|improve this answer
Should I add these to PATH and PYTHONPATH? – djq Nov 4 '10 at 10:33
Nah, the .pth file that gets installed in %PYTHONINSTALL\Lib\site-packages should take care of it for you. – Jason Scheirer Nov 4 '10 at 18:55
So where exactly do I add them? Should I create new environmental variables? Thanks for your help – djq Nov 4 '10 at 19:31
In that same dialog you posted the screen shot of. – Jason Scheirer Nov 4 '10 at 21:21
3  
Great - thank you. (To be clear for future readers, I added C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy and C:\Program Files (x86)\ArcGIS\Desktop10.0\bin) to the Python Interpreter path in eclipse. – djq Nov 4 '10 at 21:54

The same needed configuration, but in ArcGIS 10.1

enter image description here

share|improve this answer
I have been getting an unresolved error on "TableToNumPyArray" even with the settings you pointed out here, any thoughts on what the issue could be? – GuidoS Nov 27 '12 at 21:30
1  
I never tryed it before, but I have the same issue: <arcpy.da.NumPyArrayToTable(whatever...)> = "Undefined variable from import". It seems like we are missing some other path or having an import problem... I'll try to find it. – Víctor Velarde Nov 29 '12 at 15:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.