[GRASS-dev] [GRASS GIS] #932: Wingrass7 - ImportError: No module named grass - Fix PYTHONPATH?

#932: Wingrass7 - ImportError: No module named grass - Fix PYTHONPATH?
---------------------+------------------------------------------------------
Reporter: hellik | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: default | Version: svn-trunk
Keywords: | Platform: MSWindows Vista
      Cpu: x86-32 |
---------------------+------------------------------------------------------
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\v.db.addcolumn.py", line 52, in <module> import grass.script as
grass
ImportError: No module named grass.script
}}}

in the wiki
(http://trac.osgeo.org/grass/wiki/CompileOnWindows#Troubleshooting) there
are a few hints for troubleshooting, so also for

{{{
scripts/*[[BR]]
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
http://trac.osgeo.org/grass/wiki/CompileOnWindows#Grass-7.0.svntrunk),
then v.db.addcolumn works.

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

Helmut

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/932&gt;
GRASS GIS <http://grass.osgeo.org>

#932: Wingrass7 - ImportError: No module named grass - Fix PYTHONPATH?
------------------------------+---------------------------------------------
  Reporter: hellik | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.0
Component: default | Version: svn-trunk
Resolution: | Keywords:
  Platform: MSWindows Vista | Cpu: x86-32
------------------------------+---------------------------------------------
Comment (by glynn):

Replying to [ticket:932 hellik]:

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

set_paths in lib/init/functions.sh 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.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/932#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#932: Wingrass7 - ImportError: No module named grass - Fix PYTHONPATH?
------------------------------+---------------------------------------------
  Reporter: hellik | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.0
Component: default | Version: svn-trunk
Resolution: | Keywords:
  Platform: MSWindows Vista | Cpu: x86-32
------------------------------+---------------------------------------------
Comment (by hamish):

{{{
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'
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/932#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#932: Wingrass7 - ImportError: No module named grass - Fix PYTHONPATH?
----------------------+-----------------------------------------------------
Reporter: hellik | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: wingrass | Platform: MSWindows Vista
      Cpu: x86-32 |
----------------------+-----------------------------------------------------
Changes (by hellik):

  * keywords: => wingrass

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/932#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#932: Wingrass7 - ImportError: No module named grass - Fix PYTHONPATH?
------------------------------+---------------------------------------------
  Reporter: hellik | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Resolution: fixed | Keywords: wingrass
  Platform: MSWindows Vista | Cpu: x86-32
------------------------------+---------------------------------------------
Changes (by martinl):

  * status: new => closed
  * resolution: => fixed

Comment:

Already fixed, taking liberty to close this ticket.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/932#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>