[GRASS-user] Problem with Python Scripts and grass.script (GRASS 6.5SVN) on Mac

Michael Barton Michael.Barton at asu.edu
Sun Apr 3 18:27:41 EDT 2011


When I and others have had a copy of Python from python.org<http://python.org> installed, it has usually caused problems, including bogus errors. I strongly advise against it. In theory, it should not be a problem, but in reality (in my experience) it IS a problem.

I can't say for sure that this is where your problem lies, but I'd be suspicious. When you start python from the terminal, which one is it? How about from GRASS?

Michael
____________________
C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University

voice:  480-965-6262 (SHESC), 480-727-9746 (CSDC)
fax:          480-965-7671 (SHESC),  480-727-0709 (CSDC)
www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu











On Apr 3, 2011, at 12:23 PM, Johannes Radinger wrote:

Hello Glynn,
Hello Michael,

the answers to your suggestions/questions below:


Am 02.04.2011 um 17:24 schrieb Michael Barton:

Have you installed Python from python.org<http://python.org/> on your Mac? If you have, there may be a problem with that.

Yes I there is python2.6.6 from python.org<http://python.org/> installed but William Kyngesburye told me that this shouldn't be any
Problem and GRASS GIS can handle this, but I am not sure. Maybe I've to try to deinstall it, but I don't know how excatly so that everything is removed correctly also in the libs.



Michael
____________________
C. Michael Barton
Director, Center for Social Dynamics & Complexity
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University

voice:  480-965-6262 (SHESC), 480-727-9746 (CSDC)
fax:          480-965-7671 (SHESC),  480-727-0709 (CSDC)
www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.ed<http://csdc.asu.edu/>

Am 03.04.2011 um 00:37 schrieb Glynn Clements:

Johannes Radinger wrote:

I tried to figure out the problem with william kyngesburye.
the script is also working on his mac. I saved the script in the bin
folder and ran in the GRASS terminal:

AttributeError: 'module' object has no attribute 'mapcalc'


What causes this AttributeError?

The grass.script module is either broken or very old (the mapcalc()
The GRASS build I've got is compiled from last weeks source (6.5)...

function was added in December 2008).

>From within GRASS, try the following:

$ python
> import grass.script as grass
> print grass.__file__
that is what I get... does that help you?

/Applications/GRASS-6.5.app/Contents/MacOS/etc/python/grass/script/__init__.pyc

> print grass.__path__
and for the path:
['/Applications/GRASS-6.5.app/Contents/MacOS/etc/python/grass/script']


/johannes



--
Glynn Clements <glynn at gclements.plus.com<mailto:glynn at gclements.plus.com>>




More information about the grass-user mailing list