I have created python scripts in while I was in ArcGIS 9.3.1. The scripts all worked correctly in 9.3.1 and when I upgraded to 10.1 as well. Now, however, since I have upgraded to 10.2.1, many of the scripts are not working. I tested the models in ArcCatalog and they do work fine there, but when the models are ran through a python script, I get errors regarding mdb files not being supported or found.
I tried exporting the models to python scripts and entering those in instead of using the arcpy command to run the model, and the errors still come through.
I have noticed there tends to be an issue with any of the scripts that include an mdb file. I have to use that format because they are grabbing data from Access databases.
A sample script is attached below for you to review. The part of the script that triggers the mdb file in Access works correctly. So, python does still open an mdb. It just fails when trying to access an mdb file through a model......even though it works correctly in the model itself.
Any help at all would be greatly appreciated.
Solved! Go to Solution.
Are you using 64 bit python for this? If you installed the 64 bit background processing, your Python version when you run a script will likely default to 64 bit. Personal geodatabases are not supported at 64 bit, so you would have to run the script from your 32 bit python if this is the case.
If this is the issue, I have had success in the past by making simple batch files like this:
start C:\Python27\ArcGIS10.2\python.exe C:\Path\to_your_script.py
Thought I'd add this useful link to the thread. If you run into this issue with script tools run from Desktop, you may need to disable background processing.