Ticket #96 (new defect)
"import grass.script as grass" in Python GRASS AddOns doesn't work
| Reported by: | aghisla | Owned by: | osgeo4w-dev@… |
|---|---|---|---|
| Priority: | major | Component: | Package |
| Version: | Keywords: | grass addon python grass.script | |
| Cc: |
Description
I'm trying to run a Python AddOn? in OSGeo4W GRASS. There are some problems in getting grass-python module work.
- Native install:
- GRASS 6.4.0svn2
- bundled Python
Welcome to GRASS 6.4.0svn (2009)
Microsoft Windows XP [Versione 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
GRASS 6.4.0svn (spearfish60)> python C:\v.krige\v.krige.py
Traceback (most recent call last):
File "C:\v.krige\v.krige.py", line 54, in <module>
import grass.script as grass
ImportError: No module named script
- Modified install:
- as above
- python folder in C:\OSGeo4W\apps\grass\grass-6.4.0svn\etc\ substituted with the python folder in grass6_develbranch, rev 38064
GRASS 6.4.0svn (spearfish60)> python C:\v.krige\v.krige.py
Traceback (most recent call last):
File "C:\v.krige\v.krige.py", line 54, in <module>
import grass.script as grass
ImportError: No module named grass.script
GRASS 6.4.0svn (spearfish60)> python
Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on
win32
>>> import core as grass
>>> grass.run_command("g.list", type="vect")
----------------------------------------------
vector files available in mapset <PERMANENT>:
archsites roads t_9961_200 t_9961_500 t_roads_prime
...
so bundled Python can actually import the module, but not as grass.script. There's something I'm missing, but hope this report helps.
BTW, there is a similar ticket (#95) but about QGIS and not on the same issue, but also about grass module.
Change History
Note: See
TracTickets for help on using
tickets.
