Select to view content in your preferred language

Problems finding Python for ArcHydro 10.0 installation

2987
6
12-11-2012 12:40 AM
Labels (1)
RolfAalto
Emerging Contributor
For installs of ArcHydro 10.0 (version 2.1.0.132) I get this error:

"Python 2.6 was not found on the system. Please install Python 2.6 and restart this installation."

However, Python is in fact installed into the stock locations:
C:\Python26  and
C:\Python26\ArcGIS10.0

I've never had a problem with this before, most recently with ArcHydro 2.1.0.116.

Please note that Python 2.6 was originally installed using PythonXY (2.6.6.2), but ArcGIS was then installed on top of that and works just fine, including all by Python scripts.

Any suggestions would be appreciated.

Rolf Aalto
Tags (2)
0 Kudos
6 Replies
V_StuartFoote
MVP Alum
Rolf,

The Esri Water Resources developers have changed the installer logic between ArcHydro 2.1.0.116 and 2.1.0.132 to now include tests for a 64-bit Python (precursor to the 64-bit Python support with the 10.1 builds).  Although not relative for ArcGIS 10.0, the GetPythonDir function of the ISSetup.dll of the installer now tests to identify presence of a Python 2.6 instance and then configure a PYTHONDIR32, or a PYTHONDIR64 value that would only be configured/processed if no 32-bit Python is identified.  Suspect the problem is that your 32-bit Python 2.6.6 is now not being detected as the preferred Python.

A few issues to look at and post regards your 32-bit Python 2.6 installation:

1) what shows if you enter "where python" and "where pythonw" from a command prompt? Does location change when command window is "run as administrator"?

2) does your C:\Python26\ArcGIS10.0 folder contain anything more than the C:\Python26\ArcGIS10.0\Lib\site-packages\ArcHydroTools.pth file?

3) have you established a %PYTHONHOME% or %PYTHON_HOME% system variable?

4) have you made any entry in your system %PATH% providing a path to the preferred Python executables, i.e. to where python.exe and pythonw.exe are installed?

5) if you are on a 64-bit Windows OS, is there also a 64-bit Python installed?

Post answers to those questions and we'll go from there.

Stuart
0 Kudos
RolfAalto
Emerging Contributor
Thanks for your quick response to this problem.  Here is what I found:

1)  python.exe and pythonw.exe both located in "C:\Python26\", for both normal and admin.

2)  My "C:\Python26\ArcGIS10.0\Lib" folder contains 5 sub-folders and a load of *.pyc files.

3)  Yes, both are set for "C:\Python26\"

4)  Yes, my PATH variable includes "C:\Python26\Lib\site-packages;C:\Python26\Lib\site-packages\PyQt4;C:\Python26;C:\Python26\DLLs;C:\Python26\Scripts;C:\Python26\gnuplot\bin;C:\Python26\Lib\site-packages\vtk;C:\Program Files (x86)\pythonxy\console;C:\Program Files (x86)\pythonxy\SciTE-2.26;C:\Program Files (x86)\pythonxy\mingw\bin"

5)  I am running Windows 7 64 bits, but have just installed 32bit Python.
0 Kudos
V_StuartFoote
MVP Alum
Rolf,

Yup you have a mess. Suspect that when you installed ArcGIS 10.0 you may have allowed it to install Python to the C:\Python26\Arcgis10.0 directory rather than performing a Custom installation omitting Python 2.6 (and then using your existing PtyhonXY installation).

Believe your PYTHONHOME and PYTHONDIR varaibles are keeping ArcGIS Desktop functional with PythonXY--but suspect the installation of ArcHydro picked up the partial ArcGIS10.0 installation from the ArcGIS entry in the Windows registry.

You can verify that by checking for a residual registry key (only used by Esri's installer/uninstaller) pointing to HKLM\SOFTWARE\Wow6432Node\ESRI\Python10.0, if it is there it came from your Desktop10.0 install.

Suspect your additional folders in the C:\Python26\ArcGIS10.0\Lib folder are probably left over from the ArcGIS Desktop10.0 installation. Is your HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ESRI\Desktop10.0 -> Desktop10.pth registry value set to C:\Python26\lib\site-packages\Desktop10.pth or to the default C:\Python26\ArcGIS10.0\lib\site-packages\Desktop10.pth. If so, to make your PythonXY functional you would have had to copy the Desktop10.pth file to the PythonXY site-packages instance.

Also, what are the time stamps on the folders in the C:\Python26\ArcGIS10.0\Lib directory? Do they coincide with the earlier Desktop 10.0 installation, or with the ArcHydro install? I don't think the ArcHydro installers includes a Python build, so probably have always been there.

The ISSetup.dll is the module of the ArcHydro installer that does the Python detection, it is possible that it has been altered to reject anything but Python 2.6.5 and NumPy 1.3.0, but I'm more inclined to think it is a combination of residual ESRI\Python10.0 registry values affecting the installer.

For me when ArcHydro is installed against an alternate Python, it only creates the C:\Python26\ArcGIS10.0\Lib\site-packages\ArcHydroTools.pth file--this is a hardcoded installer action.

If you clean out the incorrect Esri C:\Python26\ArcGIS10.0 residuals from the file system and Windows registry, you should get a complete installation of ArcHydro 2.1.0.132. But, you may need to specify a "PYTHONDIR= C:\Python26" running the ArcHydroTools.msi installer from a command prompt. Then simply copy the C:\Python26\ArcGIS10.0\Lib\site-packages\ArcHydroTools.pth file to the C:\Python26\Lib\site-packages directory.

Stuart
0 Kudos
RolfAalto
Emerging Contributor
Thanks, Stuart.

I did do the 'Custom' installation without ArcGIS installing Python, so am not sure where things went wrong.  However, it was getting way too complicated to troubleshoot ... so I spent the morning uninstalling everything and doing a clean install of ArcGIS 10.0 without PythonXY.

It all seems to work fine now.

Rolf
0 Kudos
V_StuartFoote
MVP Alum
Rolf,

Sorry, we know a reinstall can seem pretty drastic, but sometimes is the surest way.
Unfortunately licensing and reactivation tend to discourage folks using Esri products from doing it more often.

Stuart
0 Kudos
SpencerMeyer
Deactivated User
Though I don't have ArcHydro, I'm having similar issues and found this thread really useful. Thank you!

To take it one step farther:
Can I delete the C:\Python27\ArcGIS10.1 if my python install at C:\Python27\ works fine? I copied the Desktop10.1.pth file to C:\Python27\Lib\site-packages, per your instructions above.

It seems to me like the worst case scenario is that a few packages there were installed in C:\Python27\ArcGIS10.1\Lib\site-packages might need to be reinstalled in C:\Python27\Lib\site-packages.

Also, I'm trying to switch to maintaining a directory for my third-party packages so I don't need to keep as close an eye on them when install a new version of python. I'm using C:\Python_SRM_Libs\site_packages. Is that a reasonable approach?

When I download a new package and it asks me where to save it, it seems to look in the registry for python 2.7 installations and then assume I want it there. Can I put a new variable somewhere in the registry so that it gives me my C:\Python_SRM_Libs\site_packages directory as an option when I install new packages?

thanks so much!
0 Kudos