#1671 closed defect (fixed)
grass/script/setup.py errors
Reported by: | artegion | Owned by: | martinl |
---|---|---|---|
Priority: | major | Milestone: | 6.4.3 |
Component: | Python | Version: | 6.4.2 |
Keywords: | setup | Cc: | grass-dev@… |
CPU: | Unspecified | Platform: | All |
Description
grass/script/setup.py needs a os.pathsep
at this line
## os.environ['PATH'] += os.path.join(gisbase, 'lib') ##WRONG## os.environ['PATH'] += os.pathsep + os.path.join(gisbase, 'lib')
then $GISBASE/extralib and $GISBASE/msys/bin are missed in PATH (for windows only)
## added for winGrass if sys.platform.startswith('win'): os.environ['PATH'] += os.pathsep + os.path.join(gisbase, 'extralib') os.environ['PATH'] += os.pathsep + os.path.join(gisbase, 'msys','bin')
of course we need
import sys
at the beginning
Another point ---- From outside Grass Gis we must define $GISBASE, $GISRC and add $GISBASE/etc/python to sys.path BEFORE import anything from grass (I did'nt find anything about this in Programmer's Manual)
... os.environ['GISBASE'] =gisbase grass_python_dir= os.path.join(gisbase, 'etc','python') if os.path.isdir(os.path.join(grass_python_dir,'grass')): sys.path.append(grass_python_dir) else: raise Exception('etc\python\grass module not found') os.environ['GISRC']= 'junk' from grass.script import setup gisrc= setup.init(os.getenv('GISBASE'),gisdb,location,mapset) ... os.remove(gisrc)
Change History (4)
follow-up: 2 comment:1 by , 13 years ago
Cc: | added |
---|---|
Keywords: | setup added |
Owner: | changed from | to
Status: | new → assigned |
follow-up: 3 comment:2 by , 13 years ago
follow-up: 4 comment:3 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:4 by , 12 years ago
Note:
See TracTickets
for help on using tickets.
Suggested changes applied in r52000 (trunk) and r52001 (devbr6), Backport for relbr64 requires some testing.
Martin