[GRASS-user] Re: grass.script not found?

Johannes Radinger JRadinger at gmx.at
Wed Mar 30 12:51:51 EDT 2011


-------- Original-Nachricht --------
> Datum: Wed, 30 Mar 2011 11:07:22 -0500
> Von: William Kyngesburye <woklist at kyngchaos.com>
> An: Johannes Radinger <JRadinger at gmx.at>
> CC: grass-user at lists.osgeo.org
> Betreff: Re: [GRASS-user] Re: grass.script not found?

> Check the python path.  From the GRASS terminal:
> 
> echo "$PYTHONPATH"
> 
> From python started within GRASS:
> 
> import sys
> sys.path
> 
> Both should have the GRASS app etc/python in them.

I understand sofar that I've to check it out in the GRASS Terminal (green terminal). That's what I get for sys.path:
['', '/Library/Frameworks/SQLite3.framework/Versions/3/Python', '/Library/Frameworks/GDAL.framework/Versions/1.8/Python/site-packages', '/Library/Frameworks/cairo.framework/Versions/1/Python', '/usr/local/lib/wxPython-unicode-2.8.11.0/lib/python2.6/site-packages', '/usr/local/lib/wxPython-unicode-2.8.11.0/lib/python2.6/site-packages/wx-2.8-mac-unicode', '/Library/Frameworks/Python.framework/Versions/2.6/lib/python26.zip', '/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6', '/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-darwin', '/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac', '/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac/lib-scriptpackages', '/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-tk', '/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-old', '/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload', '/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages', '/usr/local/lib/wxPython-unicode-2.8.11.0/lib/python2.6']

in the GRASS Terminal before starting pyhton i ran echo "$PYTHONPATH" but this seems empty:

Johannes-Snow-Leopard:~ Johannes Radinger$ echo "$PYTHONPATH"

Johannes-Snow-Leopard:~ Johannes Radinger$ 


Does that information help you?

/johannes

> 
> If you start python *outside* GRASS, sys.path won't have GRASS, and this
> is expected.  Same for PYTHONPATH if checked outside GRASS.








> 
> On Mar 30, 2011, at 10:52 AM, Johannes Radinger wrote:
> 
> > 
> > -------- Original-Nachricht --------
> >> Datum: Wed, 30 Mar 2011 09:44:17 -0500
> >> Von: William Kyngesburye <kyngchaos at kyngchaos.com>
> >> An: Johannes Radinger <JRadinger at gmx.at>
> >> Betreff: Re: grass.script not found?
> > 
> >> Not working here either...  Maybe that's not the right import method. 
> >> Looking at the wxgui scripts, I see one as:
> >> 
> >> from grass.script import core
> >> 
> >> So, grass.script is not a module but a group of modules.
> >> 
> >> from grass.script import *
> >> 
> >> works for me.
> > 
> > It doesn't work in my case...
> > 
> > I started Python in the terminal (the python.org 2.6.6 which is default
> on my mac) and tried:
> > 
> >>>> from grass.script import core
> > 
> > but I get the same error:
> > 
> > Traceback (most recent call last):
> >  File "<stdin>", line 1, in <module>
> > ImportError: No module named grass.script
> > 
> > I am still wondering why and think that causes the problem I've got with
> my scripts.
> > 
> > I am not sure why it is working in your case and not in mine. My
> suggestion for reasons:
> > 
> > 1) The PATH and/or the system python and pyhton.org are somehow
> conflicting
> > 2) I did something wrong during my compilation
> > 
> > Maybe we can find out together what causes the problem.
> > 
> > /johannes
> > 
> >> 
> >> On Mar 25, 2011, at 11:38 AM, Johannes Radinger wrote:
> >> 
> >>> Hej,
> >>> 
> >>> just probably a stupid question, but
> >>> the installation should also add the grass-python libs or?
> >>> 
> >>> because when I try to type in terminal-python
> >>> grass.script... there are no modules found named grass.script..
> >>> that seems strange...
> >>> 
> >>> /johannes
> >>> -- 
> >>> NEU: FreePhone - kostenlos mobil telefonieren und surfen!			
> >>> Jetzt informieren: http://www.gmx.net/de/go/freephone
> >> 
> >> -----
> >> William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
> >> http://www.kyngchaos.com/
> >> 
> >> "Mon Dieu! but they are all alike.  Cheating, murdering, lying,
> fighting,
> >> and all for things that the beasts of the jungle would not deign to
> possess
> >> - money to purchase the effeminate pleasures of weaklings.  And yet
> withal
> >> bound down by silly customs that make them slaves to their unhappy lot
> >> while firm in the belief that they be the lords of creation enjoying
> the only
> >> real pleasures of existence....
> >> 
> >> - the wisdom of Tarzan
> >> 
> >> 
> > 
> > -- 
> > NEU: FreePhone - kostenlos mobil telefonieren und surfen!			
> > Jetzt informieren: http://www.gmx.net/de/go/freephone
> > _______________________________________________
> > grass-user mailing list
> > grass-user at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/grass-user
> 
> -----
> William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
> http://www.kyngchaos.com/
> 
> "Those people who most want to rule people are, ipso-facto, those least
> suited to do it."
> 
> - A rule of the universe, from the HitchHiker's Guide to the Galaxy
> 
> 
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user

-- 
GMX DSL Doppel-Flat ab 19,99 Euro/mtl.! Jetzt mit 
gratis Handy-Flat! http://portal.gmx.net/de/go/dsl


More information about the grass-user mailing list