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

Johannes Radinger JRadinger at gmx.at
Fri Apr 1 06:57:33 EDT 2011


Okay I checked now that.
Here the results:

echo "$PYTHONPATH"
/Applications/GRASS-6.5.app/Contents/MacOS/etc/python


and for sys.path startet within the GRASS Terminal:
>>> import sys
>>> 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', '/Applications/GRASS-6.5.app/Contents/MacOS/etc/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']


That means everything is okay? but the script isnt't working on my mac.
Glynn Clements tried the script on Linux and GRASS 7.0 and it was working fine there.
Maybe anyone then me can try it on a mac machine to see if it is a specific problem
on my computer or a general mac issue.

/johannes


Am 30.03.2011 um 18:07 schrieb William Kyngesburye:

> 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.
> 
> 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



More information about the grass-user mailing list