[GRASS-dev] [GRASS GIS] #2039: Startup Error
GRASS GIS
trac at osgeo.org
Tue Jul 30 03:03:57 PDT 2013
#2039: Startup Error
------------------------------+---------------------------------------------
Reporter: akdeakin | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 6.4.4
Component: Startup | Version: 6.4.3 RCs
Keywords: wingrass, python | Platform: MSWindows 7
Cpu: x86-64 |
------------------------------+---------------------------------------------
Comment(by mlennert):
Replying to [comment:15 hamish]:
> AFAIK we use `"$GRASS_PYTHON" "$SCRIPT.py"` everywhere now, and as long
as we didn't miss any, so registry associations with other system Python
installations shouldn't matter since python.exe is called with its full
path.
This works for the GUI, but $GRASS_PYTHON is not usable when calling a
module from the command line. This is why calling python scripts from the
command line does not work in Windows. The same is true for scripts
calling scripts.
This is why we started looking into the Python launcher as a solution, and
the Python launcher does seem to be using the registry, not only for file
association, but also for the definition of PYTHONPATH.
> the trouble might be instead that the order of the PYTHONPATH is picking
up the alternate install before the grass install. You might try editing
the lines of the python code just before the traceback's line number and
add a "print sys.path" to show the path order. Right now we are adding the
grass paths to the end of that, may we need to be inserting them at the
start of the list instead.
In my installation, when I try echo %PYTHONPATH% on the command line, I
get the GRASS paths at the beginning.
>
> so sys.path.append() -> sys.path.insert(1,) ?
>
> see also : http://stackoverflow.com/questions/10095037/why-use-sys-path-
appendpath-instead-of-sys-path-insert1-path
>
> "`virtualenv` is a tool to create isolated Python environments."
;-) http://lists.osgeo.org/pipermail/grass-dev/2013-July/065212.html
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2039#comment:16>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list