enabling sahm, ImportError: No module named osr

553 views
Skip to first unread message

Amber York

unread,
Dec 19, 2013, 3:41:22 PM12/19/13
to vistrai...@googlegroups.com
Sorry if this is immediately apparent to everyone, but I'm getting an ImportError: No module named osr when I try to enable sahm 1.1.0 package in vistrails 2.1 (I tried earlier vistrails too).
If I just open a command line and do python, 
>>import osr 
then it imports fine.  What do I have to do to get vistrails to pick it up?
-Amber

Talbert, Colin

unread,
Dec 19, 2013, 7:02:27 PM12/19/13
to Amber York, vistrai...@googlegroups.com
Hello Amber,
     I'm guessing you're installing SAHM either on a mac or not without the prebuilt Windows installer.  There's a small bug in our code that doesn't manifest itself on the installation from the Windows installer.

If you're comfortable editing a python file you just need to change line 51 of sahm\pySAHM\FieldDataAggreagateAndWeight.py

from:
import osr
to:
from osgeo import osr

When you restart VisTrails you should be able to load the package.


I'll be pushing that change up to GitHub shortly as well (I'm assuming this is where you got the package).

Thanks for spotting that bug.  I'd love to hear your thoughts on sahm.

Colin


Colin Talbert
GIS Analyst and Developer
US Geological Survey


USGS Fort Collins Science Center 
2150 Centre Ave. Bldg. C
Fort Collins, CO 80526

USGS North Central Climate Science Center

Work schedule:
Monday       - 7:00 - 3:00  (NC CSC)
Tuesday       -  7:00 - 3:00  (NC CSC)
Wednesday  -  7:00 - 3:00 (FORT)
Thursday      -  7:00 - 5:00 (NC CSC)
Friday          -  7:00 - 5:00 (FORT)


--
You received this message because you are subscribed to the Google Groups "VisTrails SAHM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vistrails-sah...@googlegroups.com.
To post to this group, send email to vistrai...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Amber York

unread,
Dec 20, 2013, 9:23:47 AM12/20/13
to vistrai...@googlegroups.com, Amber York
Thanks for getting back to me on this.  I was able to enbable the SAHM package. I made the change you suggested and it said it couldn't find module osgeo.  What I ended up doing was copying "osgeo" from my C:/Python27/Lib/site-packages
to C:\Program Files\VisTrails\Python27_64\Lib\site-packages

I hadn't realized VisTrails couldn't pick up my C:/Python27/Lib packages even though it is in my environmental variables.

I'm having a different issue now where when I try to execute it gets hung on PARC with the following message.

"from core.configuration import ConfigurationObject
 ImportError: No module named core.configuration"

Amber York

unread,
Dec 20, 2013, 9:24:54 AM12/20/13
to vistrai...@googlegroups.com, Amber York
I mean in the tutorial I tried to execute.

Talbert, Colin

unread,
Dec 20, 2013, 2:24:54 PM12/20/13
to Amber York, vistrai...@googlegroups.com

Hello Amber,

Yes VisTrails executes from it's own full installation of Python so that it doesn't run into library incompatibilities with what's already installed.  Installing new packages into this independent Python install can be a bit confusing at first, but it sounds like you got that figured out.

The error you're getting in PARC is related to the switch from 2.0.3 to 2.1beta of VisTrails. The VisTrails developers changed the organization of the VisTrails components in this update. They did add some functionality to make this change backwards compatible but it doesn't seem to be working our for the sahm package always.  In this case from core.configuration import ConfigurationObject needs to now be from vistrails.core.configuration import ConfigurationObject.  This same pattern occurs several other places in our code.  I'll check with them to see if there is an easy solution, but it might be a few days before I can make the change and make sure everything still works.

I'll post to the group when this is finished.  In the meantime you could try to run it from a 2.0.3 version.  Or if you're on Windows the VisTrails:sahm installer has been fairly trouble free.  If you're not on windows there are some some changes to the package and the tutorial that I'll need to provide you.

Thanks,
Colin

Colin Talbert
GIS Analyst and Developer
US Geological Survey


USGS Fort Collins Science Center 
2150 Centre Ave. Bldg. C
Fort Collins, CO 80526

USGS North Central Climate Science Center

Work schedule:
Monday       - 7:00 - 3:00  (NC CSC)
Tuesday       -  7:00 - 3:00  (NC CSC)
Wednesday  -  7:00 - 3:00 (FORT)
Thursday      -  7:00 - 5:00 (NC CSC)
Friday          -  7:00 - 5:00 (FORT)


Reply all
Reply to author
Forward
0 new messages