Opened 14 years ago

Closed 10 years ago

#932 closed defect (fixed)

Wingrass7 - ImportError: No module named grass - Fix PYTHONPATH?

Reported by: hellik Owned by: grass-dev@…
Priority: normal Milestone: 7.0.0
Component: Default Version: svn-trunk
Keywords: wingrass Cc:
CPU: x86-32 Platform: MSWindows Vista


self compild grass7 in the osgeo4w-stack

if i want to start for example v.db.addcolumn from the wx-table-manager, there is following error:

Traceback (most recent call last):
File "C:\osgeo4w\usr\src\grass_trunk\dist.i686-pc-mingw32\", line 52, in <module> import grass.script as grass
ImportError: No module named grass.script

in the wiki ( there are a few hints for troubleshooting, so also for

ImportError: No module named grass[[BR]]
Fix PYTHONPATH  to *nix-style (eg. PYTHONPATH=/osego4w/apps/Python25) 

so if i change this in c:\osgeo4w\etc\ini\msys.bat (following, then v.db.addcolumn works.

so where should this change integrated directly in source for working wingrass7 out of the box?


Change History (4)

in reply to:  description comment:1 by glynn, 14 years ago

Replying to hellik:

so where should this change integrated directly in source for working wingrass7 out of the box?

set_paths in lib/init/ already sets PYTHONPATH, provided that it isn't already set.

Python itself is going to expect PYTHONPATH to be in native Windows format. However, MSys may "fix" environment variables when invoking non-MSys programs.

If this is an OSGeo4W-specific issue, it should be dealt with as such. Nothing in the GRASS source tree should be hard-coding OSGeo4W-specific settings.

comment:2 by hamish, 14 years ago

trunk/mswindows$ grep -rn PYTHONPATH *

GRASS-Installer.nsi:644:        FileWrite $0 '# Set the PYTHONPATH variable$\r$\n'
GRASS-Installer.nsi:645:        FileWrite $0 'PYTHONPATH="$$GISBASE/etc/python:$$GISBASE/Python25:$$PYTHONPATH"$\r$\n'
GRASS-Installer.nsi:646:        FileWrite $0 'export PYTHONPATH$\r$\n'

comment:3 by hellik, 13 years ago

Keywords: wingrass added

comment:4 by martinl, 10 years ago

Resolution: fixed
Status: newclosed

Already fixed, taking liberty to close this ticket.

Note: See TracTickets for help on using tickets.