ArcGIS installs its own version of Python that is not officially registered with the system but can in reality be used just like a normal install. I personally prefer just to use this as my primary Python, but it is not always possible. The instructions below can help you let a different Python install access and use Arcpy, for example the Python installed by Python(x,y). Note that:
To allow other Python installations to access Arcpy this path file simply needs to be copied from the Lib\site-packages\ folder within the Arc Python installation and placed in the corresponding folder of the non-Arc Python. If you have not installed 64-bit background geoprocessing the file is Desktop10.1.pth; if you have installed it, the file is DTBGGP64.pth.
As an aside: as far as I know it is not possible to move the Python that is installed by ArcGIS. Uninstalling and reinstalling ArcGIS should allow you to change the Python install location, except in the case of some silent network installs.
أكثر...
- the major versions must match (2.6 for ArcGIS 10.0 and 2.7 for ArcGIS 10.1)
- the architecture (32 bit or 64 bit) must match (see the start of this post for information on determining Python version and architecture)
- if you write scripts and use these as script tools within Arc they will use the Python installed by Arc; this means that any libraries you have installed to the other Python, but not installed to the ArcGIS Python, will be inaccessible (causing an ImportError)
To allow other Python installations to access Arcpy this path file simply needs to be copied from the Lib\site-packages\ folder within the Arc Python installation and placed in the corresponding folder of the non-Arc Python. If you have not installed 64-bit background geoprocessing the file is Desktop10.1.pth; if you have installed it, the file is DTBGGP64.pth.
As an aside: as far as I know it is not possible to move the Python that is installed by ArcGIS. Uninstalling and reinstalling ArcGIS should allow you to change the Python install location, except in the case of some silent network installs.
أكثر...