Bug with "Database Connection" in Python using 10.1

909
12
Jump to solution
02-01-2013 11:15 AM
GregoryDillon
New Contributor III
I just installed 10.1 on my PC.   Now when I run my Python script it no longer recognizes any connection coded like "Database Connection\Connection to ...".    These connections work in ArcMap and ArcCatalog.   When I create a Model using these connections, the model works.   When I export the Model to a Python script the model it fails.    If I replace the "Database Connections\..." path prefix with something like "C:\Users\SomeUser\AppData\Roaming\ESRI\Desktop10.1\ArcCatalog\..." it works.   In short Python is not resolving "Database Connections" to the actual location of the connections (ie. "C:\Users\SomeUser\AppData\Roaming\ESRI\Desktop10.1\ArcCatalog").   I have SP1 installed on the ArcGIS 10.1 for Desktop.    My C: drive has both a "Python26" and a "Python27" directory.   Maybe its getting confused where to run Python?    Also it looks like ArcCatalog/ArcMap run as 32 bit where as Python runs as 64-bit.   Is there something I can do to configure the 64-bit side to find "Database Connections".   

Please help!   Thanks!
Tags (2)
0 Kudos
12 Replies
eddiequinlan
Occasional Contributor
Thanx Wayne,

I've seen some discussions on this, but when i try to redirect the connection to the 32bit python I'm having trouble with the correct syntax.  do you have an example of redirecting that connection?

eddie
0 Kudos
eddiequinlan
Occasional Contributor
Thanx again Wayne,

I figured it out.  I didn't realize the redirection to the 32 bit python had to be done in a .bat file or command line.  I was trying to make it part of the actual python script.  If this helps anyone here is how I ran it.......

C:\Python27\ArcGIS10.1\python.exe C:\...\...\whatever_python_script.py
0 Kudos
T__WayneWhitley
Frequent Contributor
Should also be able to make it run in the 'foreground'....like if you make it a script tool, there's a setting - just you'll have to remember when you want to run in 'background' mode (taking advantage of your 64-bit py exe) then you'll have to make sure you are specifying that.  Glad you figured it out and are running.


Enjoy,
Wayne
0 Kudos