access ArcPy modules in PyScripter or other Python installation

4031
1
02-09-2015 05:49 PM
Leo_KrisPalao
New Contributor II

Hi ArcPy users,

Just would like to ask how can I use arcpy modules in PyScripter or Python2.7.9? It seems that PyScripter or Pyhton2.7.9 IDE/commandline cannot recognize the modules of arcpy. I want to have an integrated environment where I can use both Python2.7.9 modules and arcpy modules.

What I have done so far:

I created PYTHONPATH in system variables and set the following folder path, e.g.

  PYTHONPATH =

C:\OSGeo4W\apps\Python27;C:\OSGeo4W\apps\qgis\bin;C:\OSGeo4W\apps\qgis\python;C:\Python27\ArcGISx6410.2;C:\Python27\ArcGISx6410.2\Scripts;C:\Python27\Python2.7.9;C:\Python27\Python2.7.9\Scripts;C:\Python27\ArcGISx6410.2\Lib;C:\Python27\ArcGISx6410.2\Lib\site-packages;C:\Python27\ArcGIS10.2\Lib\site-packages;C:\Python27\ArcGIS10.2\Lib

I added C:\Python27\ArcGISx6410.2\Lib;C:\Python27\ArcGISx6410.2\Lib\site-packages in PATH in system variables

When I open my Python 2.7.9 (installed separately) and run import arcpy I still got the message:

ImportError: No module named arcpy.

Thanks,

-Leo

0 Kudos
1 Reply
DanPatterson_Retired
MVP Emeritus

ArcGIS is quite particular about where python is installed and how.  Normally when you install ArcMap, Python is installed appropriately, should wish to have Pyscripter, Pythonwin or other IDEs you install them after and things will be fine.  Should you wish to toy with sequence, then you will have to troll on how to correct and/or produce paths so that all the software you use can find python.  What I suggest is the simplest, there are others that have tweeked installation paths to use more recent versions of python for whatever purposes.  Good luck

0 Kudos