Moving location of the Python27 directory

817
1
08-04-2012 02:09 PM
DavidStrip
New Contributor II
I want to move the Python27 directory to a different location. How do I tell ArcGIS how to find the new place?
Is the distribution from ESRI a strict superset of the standard distribution? ie, as long as I don't have anything in site-packages that I'll miss, can I just throw away my existing Python27 directory that was download from the python site?
What is the highest release number within 2.7 that is valid for ArcGIS?
Tags (2)
0 Kudos
1 Reply
KimOllivier
Occasional Contributor III
I thought that this was fixed in 10.1 to use the standard install.
I prefer python to be in C:\Python27 so that all other modules have this expected location. Some things such as the python help seem to be hardcoded for this location, not c:\Python27\ArcGIS10.1

All you have to do is save the Desktop10.1.pth file in site-packages, and the other modules numpy and matplotlib, uninstall python, delete the pesky directory and reinstall python2.7.x from the standard distribution. Then copy back the modules and the pth file which locates the arcpy modules.

Each time you install a service pack, rerun the python install to repair the paths back to normal.
I have never had any problem with any dot release of the main version eg 2.6.x or 2.7.x which should only be bug fixes.
You may not get the bug fixed if you run the script in-process because the python version is imbedded.

While you are there, install the Pythonwin package which gives you extra modules to win32 API, COM interfaces to MS Office applications, message boxes and even the registry.

A new location? Be careful what you do about that. You cannot have any spaces in the path. Maybe you are an 'administrator' who thinks that c:\Program Files (x86) would be tidier? You will condemn everyone to inexplicable crashes and error messages.
0 Kudos