import arcpy arcpy.env.workspace = "\\\\STSHURON\\data\\gis_work\\data_maint\\Monthly_Update\\" wrkspc = arcpy.ListWorkspaces() for workspace in wrkspc: print workspace
Solved! Go to Solution.
so i have been having problems accessing tables in an mdb using arcpy on our server running arcgis10.1.
i think i have figured out part of the problem.
running this script:import arcpy arcpy.env.workspace = "\\\\STSHURON\\data\\gis_work\\data_maint\\Monthly_Update\\" wrkspc = arcpy.ListWorkspaces() for workspace in wrkspc: print workspace
running the identical script (above) our 10.1 machine lists none of the mdb files in the directory as workspaces. on our 10.0 box all the mdb's in the directory are listed. all the other files that could be listed as workspaces in the directory (other directories, excel files, etc.) are listed when the script is run on either box; the only difference seems to be the access databases don't show up with the script on the 10.1 box. any ideas as to why that is?
thanks!
max
import arcpy, sys arcpy.env.workspace = r'G:\Data\Geodatabase\Archive' print "Running against: {0}\n".format(sys.version) for ws in arcpy.ListWorkspaces(): print ws
>>> ================================ RESTART ================================ >>> Running against: 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] G:\Data\Geodatabase\Archive\Cedar_County_Switched_1_23_2013.gdb G:\Data\Geodatabase\Archive\Cedar_County_Switched_1_23_2013.mdb G:\Data\Geodatabase\Archive\Cedar_Switched_1_23_2013.gdb G:\Data\Geodatabase\Archive\Cedar_Switched_1_23_2014.mdb >>>
>>> Running against: 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] G:\Data\Geodatabase\Archive\Cedar_County_Switched_1_23_2013.gdb G:\Data\Geodatabase\Archive\Cedar_Switched_1_23_2013.gdb >>>
so i have been having problems accessing tables in an mdb using arcpy on our server running arcgis10.1.
i think i have figured out part of the problem.
running this script:import arcpy arcpy.env.workspace = "\\\\STSHURON\\data\\gis_work\\data_maint\\Monthly_Update\\" wrkspc = arcpy.ListWorkspaces() for workspace in wrkspc: print workspace
running the identical script (above) our 10.1 machine lists none of the mdb files in the directory as workspaces. on our 10.0 box all the mdb's in the directory are listed. all the other files that could be listed as workspaces in the directory (other directories, excel files, etc.) are listed when the script is run on either box; the only difference seems to be the access databases don't show up with the script on the 10.1 box. any ideas as to why that is?
thanks!
max
import arcpy, sys arcpy.env.workspace = r'G:\Data\Geodatabase\Archive' print "Running against: {0}\n".format(sys.version) for ws in arcpy.ListWorkspaces(): print ws
>>> ================================ RESTART ================================ >>> Running against: 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] G:\Data\Geodatabase\Archive\Cedar_County_Switched_1_23_2013.gdb G:\Data\Geodatabase\Archive\Cedar_County_Switched_1_23_2013.mdb G:\Data\Geodatabase\Archive\Cedar_Switched_1_23_2013.gdb G:\Data\Geodatabase\Archive\Cedar_Switched_1_23_2014.mdb >>>
>>> Running against: 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] G:\Data\Geodatabase\Archive\Cedar_County_Switched_1_23_2013.gdb G:\Data\Geodatabase\Archive\Cedar_Switched_1_23_2013.gdb >>>
Have you installed the 64 bit background processing for your 10.1 version? This is not compatible with personal geodatabases. In this case you have to use the 32 bit python. The 64 bit will not list the personal gdb's. Here's an example:import arcpy, sys arcpy.env.workspace = r'G:\Data\Geodatabase\Archive' print "Running against: {0}\n".format(sys.version) for ws in arcpy.ListWorkspaces(): print ws
here are the results when ran from 32 bit:>>> ================================ RESTART ================================ >>> Running against: 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] G:\Data\Geodatabase\Archive\Cedar_County_Switched_1_23_2013.gdb G:\Data\Geodatabase\Archive\Cedar_County_Switched_1_23_2013.mdb G:\Data\Geodatabase\Archive\Cedar_Switched_1_23_2013.gdb G:\Data\Geodatabase\Archive\Cedar_Switched_1_23_2014.mdb >>>
And here is the exact same script ran on 64 bit:>>> Running against: 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] G:\Data\Geodatabase\Archive\Cedar_County_Switched_1_23_2013.gdb G:\Data\Geodatabase\Archive\Cedar_Switched_1_23_2013.gdb >>>
As you can see it only listed the 2 file gdb's and not the personal gdb's when ran with 64 bit python.
start C:\Python27\ArcGIS10.1\python.exe G:\Misc\Scripts\UNMPD_PARCELS.py
OR if you want to open in in the regular python shell the other option is to open up the 32 bit python.exe in the normal ArcGIS 10.1 folder (I created shortcuts for both 32 bit and 64 bit to my desktop) and once you are in there you can manually open your script with File > Open.
I believe so. Using the 32 bit PythonWin is a good idea, may be the easiest way to handle scripts that use personal gdb's. That way you can avoid the confusion about which version of IDLE you are using.
what is better about the 64bit version (IE: why not just uninstall the 64bit version and run everything in the 32bit version of pythonwin to avoid confusion)?