Uninstall Python 2.7 / Install ArcGIS 10.1 with out Python

6559
13
Jump to solution
09-06-2012 05:32 AM
MRLocator
New Contributor III
Hello,

I am migrating from ArcGIS Desktop 9.3.1 to 10.1.  Since we never use Python I wanted to find a way to install 10.1 without the new Python 2.7.  Unlike the previous version of Python (v2.5.1) that came preinstalled with 9.3.1 the new Python does not appear to be listed under Programs and Features (Win7) or Add/Remove programs (XP).  The uninstall string for Python 2.7 is not listed in the typical uninstall directory of the registry either.

For example to remove Python 2.5.1 from a VBScript I would use the following command:
WshShell.Run("C:\Python25\UNWISE.EXE /S C:\Python25\INSTALL.LOG",True,0)

My solution for now has been to simply delete the Python 2.7 folder (C:\Python27) when my 10.1 installation script is complete.  While my technique is effective it does leave a lot of shrapnel in the registry.  I cannot help but wonder if there is a more official process for removing this unecessary software from my machines.  The ArcGIS install guide has not been helpful in customizing my installation to my requirements.

ArcGIS Python Requirement:
http://resources.arcgis.com/en/help/install-guides/arcgis-desktop/10.1/index.html#/Python_requiremen...


Ideas or suggestions?
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
MRLocator
New Contributor III
Thank you for the responses.

Although it is not recommended, it surely is not impossible to do what we want. We are aware of the risks but the Python functionality will not be missed. 

As I re-read the installation guide I had an idea that seems to be working.  Instead of running the full install and cleaning up Python after I believe we can run a customized install so that Python is never installed in the first place.

Here is my new installation string for ArcGIS 10.1:
WshShell.Run("msiexec.exe /i " & Chr(34) & strInstallPath & "setup.msi" & chr(34) & " " & _
                    "ESRI_LICENSE_HOST=ArcServerManager " & _
                    "SOFTWARE_CLASS=Viewer " & _
                    "SEAT_PREFERENCE=Float " &  _
                    "DESKTOP_CONFIG=TRUE " & _
                    "BLOCKADDINS=#4 " & _
                    "ADDLOCAL=ArcMap,ArcCatalog " & _
                    "/qb", 1, TRUE)

The key difference is the new ADDLOCAL= requirement that was added to the end of the string.  With this requirement in place only ArcMap, ArcCatalog, ArcAdministrator, Desktop Help and Desktop Tools are installed on my test machine.  This is perfect for what we need...and no Python to worry about cleaning up afterwards.

Should I ever discover a need to install Python I feel it will be more beneficial to create a custom installation package that takes advantage of the normal 2.7 msi.  Atleast when you install with a msi the cleanup is easy and well documented.  Whatever ArcGIS does to install Python seems to be half baked.

View solution in original post

0 Kudos
13 Replies
MathewCoyle
Frequent Contributor
Not recommended. Python is a dependency, there are several tools that will break if you remove Python.
0 Kudos
ChristopherThompson
Occasional Contributor III
The first line of that link tells you everything you need to know about this course of action:
ArcGIS for Desktop geoprocessing tools require that Python 2.7.x and Numerical Python 1.6.1 are installed.
0 Kudos
MRLocator
New Contributor III
Thank you for the responses.

Although it is not recommended, it surely is not impossible to do what we want. We are aware of the risks but the Python functionality will not be missed. 

As I re-read the installation guide I had an idea that seems to be working.  Instead of running the full install and cleaning up Python after I believe we can run a customized install so that Python is never installed in the first place.

Here is my new installation string for ArcGIS 10.1:
WshShell.Run("msiexec.exe /i " & Chr(34) & strInstallPath & "setup.msi" & chr(34) & " " & _
                    "ESRI_LICENSE_HOST=ArcServerManager " & _
                    "SOFTWARE_CLASS=Viewer " & _
                    "SEAT_PREFERENCE=Float " &  _
                    "DESKTOP_CONFIG=TRUE " & _
                    "BLOCKADDINS=#4 " & _
                    "ADDLOCAL=ArcMap,ArcCatalog " & _
                    "/qb", 1, TRUE)

The key difference is the new ADDLOCAL= requirement that was added to the end of the string.  With this requirement in place only ArcMap, ArcCatalog, ArcAdministrator, Desktop Help and Desktop Tools are installed on my test machine.  This is perfect for what we need...and no Python to worry about cleaning up afterwards.

Should I ever discover a need to install Python I feel it will be more beneficial to create a custom installation package that takes advantage of the normal 2.7 msi.  Atleast when you install with a msi the cleanup is easy and well documented.  Whatever ArcGIS does to install Python seems to be half baked.
0 Kudos
StacyRendall1
Occasional Contributor III
Should I ever discover a need to install Python I feel it will be more beneficial to create a custom installation package that takes advantage of the normal 2.7 msi.  Atleast when you install with a msi the cleanup is easy and well documented.  Whatever ArcGIS does to install Python seems to be half baked.


If you only need to use Python without any ArcGIS tools this will work just fine. However, you will be completely unable to use Arcpy from that separate Python.

The Python install is not half baked, it is just intended to be a private install, i.e. only for use by ArcGIS and scripts written specifically within the IDLE editor included with ArcGIS Python. Plenty of programs do this, i.e. Inkscape, however many people (including me) use other editors/IDEs or wish to use the ArcGIS Python for doing other Python programming, which requires a little jiggling of Paths, etc.
0 Kudos
MRLocator
New Contributor III
Stacey,

We have no need to use ArcPy or the regular Python.  Can't say that I have heard of any of the other examples you mentioned either.  All we have ever wanted to do was basic map editing and creation which does not appear to be dependant on Python in any way.

Here's what I know.  Python of any flavor is a liability and a vulnerability to have installed on a computer.  It is frequently registered as a security issue on the US-Cert Bullitins (http://www.us-cert.gov/cas/bulletins/).  As a responsible Administrator I have to go through those bullitins and spend time on Python each time it is mentioned to ensure there is no threat.  Now that Python is no longer on my machines it is no longer an issue and I am a happy camper.

Unless we discover a compelling need to have Python on our machines I'd rather make due without it.  The fact that Python can be disabled via a proper installation string is all the confirmation that I need to proove that it is not actually a requirement for the ArcGIS software.
0 Kudos
curtvprice
MVP Esteemed Contributor
Now that Python is no longer on my machines it is no longer an issue and I am a happy camper.


Somehow, I doubt your users are as happy as you are.

Without Python you are disabling many useful ArcGIS tools. For example, there are many ArcGIS tools that are Python scripts that assist with repetitive actions. By disabling Python you are seriously hobbling your users' productivity (especially with GIS data development, which often involves repetitive task flows).

My two cents, based the last 30 years on both sides of the security fence:

Computer security must be a balance between allowing people to get their work done and keeping systems as safe as possible. Users are the most important part of the security picture (think, email attachments, account security, social engineering) and are less likely to be team players when you lock down their systems to the point that you are making it difficult to do their work. Furious users may be a much bigger security threat than anything you read about on the CERT bulletins.
0 Kudos
curtvprice
MVP Esteemed Contributor
If you only need to use Python without any ArcGIS tools this will work just fine. However, you will be completely unable to use Arcpy from that separate Python.


I have successfully worked around this with the Enthought Python Distribution by starting EPD with a bat script that adds ArcGIS paths to the PYTHONPATH:

:: start EPD32 python prompt with arcpy available
@echo off
set EPDPATH=E:\python27_epd32
set AGSPATH=D:\ArcGIS\Desktop10.1
:: save paths
set PATHENV=%PATH%
set PPATHENV=%PYTHONPATH%
:: set paths EPD with access to arcpy
set PATH=%EPDPATH%;%EPDPATH%\scripts;%PATH%
set PYTHONPATH=%PYTHONPATH%;%AGSPATH%\bin;%AGSPATH%\arcpy;%AGSPATH%\ArcToolbox\Scripts
cmd /c %EPDPATH%\python.exe
:: restore paths
set PATH=%PATHENV%
set PYTHONPATH=%PPATHENV%
:: delete variables
set EPDPATH=
set AGSPATH=
set PATHENV=
set PPATHENV=
0 Kudos
MRLocator
New Contributor III
Thanks again for all the responses.

Although this thread never really answered my question on how to uninstall Python 2.7 it is helpful for trying to understand some reasons to keep it around.  Looking back through all of the suggestions I still doubt that my users or I have any need for the Python tools or scripts while in the ArcGIS envionrment.  So far nothing has been mentioned that sounds familiar to what we need to use this software for.

Perhaps someone could elaborate on some specific tools or features that are known to be dependant on Python/ArcPy?  

Otherwise it appears that the script provided by Curt can be used to take advantage of the normal Python 2.7 installation.  I'd much rather have a regular version of Python on my machines then the "private" installation that comes packaged with ArcGIS 10.1.
0 Kudos
curtvprice
MVP Esteemed Contributor
Although this thread never really answered my question on how to uninstall Python 2.7 it is helpful for trying to understand some reasons to keep it around.


If you interactively launch the Setup.msi and choose "modify" you can uninstall Python, like any other piece of the system. I did this yesterday and it worked fine. I'm sure there is a way to batch this using msiexec if you need to.

Otherwise it appears that the script provided by Curt can be used to take advantage of the normal Python 2.7 installation.  I'd much rather have a regular version of Python on my machines then the "private" installation that comes packaged with ArcGIS 10.1.


I'm pretty sure there is nothing different about the Esri "private" python/numpy (+matplotlib in 10.1) package from the 2.7.2 you'd download from python.org except it is the exact version they test all the tools against. If you want to install it separately the install packages are in the Python folder in the ArcGIS install media.

The only thing that makes it "Esri" I think is the default location (Python27\ArcGIS10.x), its packaging with ArcGIS in Add/Remove Programs, and the .pth file the ArcGIS installer drops in the site-packages folder so you can see arcpy. Esri folks have told me  they expect any 2.6.x python to work with ArcGIS 10 and any 2.7.x python to work with ArcGIS 10.1. But of course the versions they release with ArcGIS are best practice of you have no special need for a different Python version.
0 Kudos