Error setting workspace in arcpy.env

Discussion created by sarahereed on Oct 12, 2011
Latest reply on Oct 12, 2011 by mzcoyle

I am encountering errors with setting a workspace file path in some installations of ArcGIS 10. When I run the code in a Python editor, it runs fine. When I run the code in the Python window or as a script tool, it fails on 2 out of 4 machines I have tested, resulting in the error message 00732: the dataset doesn't exist or is not supported.

Here is the relevant section of code:

# Import system modules
import sys, os, string, arcpy

# Define workspace
arcpy.env.workspace = "c:/WorkSpace/Exercise3"

# Set overwrite option
arcpy.env.overwriteOutput - True

# Define the input datasets
cities = "Larimer_Cities.shp"
county = "Larimer_County.shp"


The script fails when it calls for the first input dataset, which it does not find. I have tried various ways of representing the workspace filepath (/, \\, r"..), and the only successful workaround I have found is to specify the full filepath for all input and output datasets. Since this only happens on some of the ArcGIS installations I have tested, it leads me to believe that somehow the environment setting for workspace is being overridden. Any ideas?