Configuring arcpy intellisense

2686
4
06-23-2011 06:50 AM
RoyHewitt
New Contributor III
I've installed eclipse and pydev, but cannot get code-completion to work with the arcpy module.  I've copied the arcpy folder over into \Python26\ArcGIS10.0\Lib for the python interpreter of pydev with no luck.

Am I missing something?
Tags (2)
0 Kudos
4 Replies
KimOllivier
Occasional Contributor III
Do you need Eclipse just to write a geoprocessing script? Pythonwin is probably sufficient.

In Pythonwin you just import arcpy in the interactive window. This checks out a licence and enables intellisense for the script window as well as the interactive window. Maybe the same process for Eclipse?
0 Kudos
RoyHewitt
New Contributor III
I've had no problem using PyScripter, but I use the Aptana plugin for eclipse for JavaScript (+ Dojo and ArcGIS JavaScript code complete libraries).  I'd prefer to have a one-stop-shop for development if possible.
0 Kudos
StacyRendall1
Occasional Contributor III
Roy, it is strange you are having issues. I use Netbeans sometimes, and its code helping for Arcpy worked right out of the box (once I pointed it to the Python installation) - no need to copy anything.


  1. Can you explain what it was you copied again; from where to where? I'm pretty sure this should not have been necessary...


  2. Are you using the Python installation that ArcGIS installed? Is it properly set as your Python interpreter in Eclipse? What happens if you load the command prompt in Eclipse and enter 'import arcpy'? If this fails, it probably is the incorrect Python being referenced by Eclipse - trawl through the settings and see what you can find.


Things like Intellisense scan through all the available Python modules and index/generate documentation for everything they find; as Arcpy is an available Python module for the Python installed by ArcGIS, it should be automatic.
0 Kudos
deleted-user-4RbHy6ryQ4a8
New Contributor III
Roy,

I'm using Eclipse+Pydev and love it.  There is more overhead to learn, but you get a powerful IDE instead of just an editor.

You shouldn't copy anything.

1. Set up interpreter: 
Preferences > PyDev > Interpreter - Python > New
Make sure the following are checked:
  C:\Program Files (x86)\ArcGIS\Desktop10.0\bin
  C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy
  C:\Program Files (x86)\ArcGIS\Desktop10.0\ArcToolbox\Scripts

2. Add arcpy to forced-builtins:
After interpreter is set up, click on "Forced Builtins" tab > "New..." button > enter arcpy


Correction #1:
C:\Python26\ArcGIS10.0\Lib\site-packages\Desktop10.pth defines these paths for your python installation, but it appears that PyDev needs to define them directly, it doesn't seem to respect the .pth files

Correction #2:
It looks like you must use forced built-ins:
http://pydev.org/manual_101_interpreter.html#id8
0 Kudos