[GRASS-user] Re: grass.script not found?
William Kyngesburye
woklist at kyngchaos.com
Wed Mar 30 12:07:22 EDT 2011
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
More information about the grass-user
mailing list