Running GDAL scripts in ESRI Model Builder

From Wildsong
Revision as of 17:18, 14 June 2013 by Brian Wilson (talk | contribs)
Jump to navigationJump to search

I have a script that runs fine standalone but I need it to run in ESRI Model Builder. I am doing this for a client. I avoid Model Builder because scripts are maintainable and reliable.

I am using the versions of Python, GDAL, and Shapely.

The script won't run in Model Builder because it sets up its environment for the ESRI version of Python 2.6. This is the symptom

TypeError: cannot create weak reference to 'classobj' object

I believe this means the python interpreter is getting confused and trying to import from the wrong site packages. I think I can use virtualenv to get around this problem.

I found these instructions and I am following them right now. http://www.tylerbutler.com/2012/05/how-to-install-python-pip-and-virtualenv-on-windows-with-powershell/