Running GDAL scripts in ESRI Model Builder: Difference between revisions
From Wildsong
Jump to navigationJump to search
Brian Wilson (talk | contribs) m Created page with '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 rel…' |
Brian Wilson (talk | contribs) mNo edit summary |
||
Line 4: | Line 4: | ||
I am using the versions of Python, GDAL, and Shapely. | 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. | 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 [https://pypi.python.org/pypi/virtualenv virtualenv] to get around this problem. | I think I can use [https://pypi.python.org/pypi/virtualenv virtualenv] to get around this problem. | ||
I found these instructions and I am following them right now. | 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/ | http://www.tylerbutler.com/2012/05/how-to-install-python-pip-and-virtualenv-on-windows-with-powershell/ |
Revision as of 17:18, 14 June 2013
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/