Send grass-windows mailing list submissions to grass-windows@lists.osgeo.org
To subscribe or unsubscribe via the World Wide Web, visit http://lists.osgeo.org/mailman/listinfo/grass-windows or, via email, send a message with subject or body 'help' to grass-windows-requ...@lists.osgeo.org You can reach the person managing the list at grass-windows-ow...@lists.osgeo.org When replying, please edit your Subject line so it is more specific than "Re: Contents of grass-windows digest..." Today's Topics: 1. Re: r.basin for windows [was Re: WinGrass6.5.svn-installer with selected addons] (Glynn Clements) 2. Re: r.basin for windows [was Re: WinGrass6.5.svn-installer with selected addons] (Helmut Kudrnovsky) ---------------------------------------------------------------------- Message: 1 Date: Fri, 21 Oct 2011 16:34:24 +0100 From: Glynn Clements <gl...@gclements.plus.com> Subject: [GRASS-windows] Re: r.basin for windows [was Re: WinGrass6.5.svn-installer with selected addons] To: Helmut Kudrnovsky <hel...@web.de> Cc: grass-windows@lists.osgeo.org Message-ID: <20129.37120.947348.972...@cerise.gclements.plus.com> Content-Type: text/plain; charset=us-ascii Helmut Kudrnovsky wrote: > >> there are following error messages: > > > >> File "C:\Program Files\GRASS6.5.SVN\Python25\lib\threading.py", line 13, > >> in <module> > >> from collections import deque > >> ImportError: No module named collections > > > >This is a common error caused by a broken Python installation or > >attempting to mix Python versions (e.g. setting PYTHONPATH or > >PYTHONHOME to point to one version but using the Python interpreter > >from a different version). > > ok. > > there is the python bundled with wingrass65 and a few other ones i.e. > installed by arcgis > (in C:\Python26\ArcGIS10.0\) or by openoffice (in C:\Program > Files\OpenOffice.org 3\program) > or inkscape (C:\Program Files\Inkscape\python) etc. here on my box. > > so some source of messing up? > > why is then the wxgui working normally? The wx GUI is invoked via $GRASS_PYTHON. This was originally done because the wx GUI contained binary modules (vdigit and nviz) which would only work with the specific version of the Python interpreter for which they were compiled. > >With respect to GRASS, the usual reason for this error is the attempt > >to "bundle" a copy of Python in the GRASS installer. > > > >Bear in mind that, on Windows, "executing" a Python script (whether > >from cmd.exe, the GUI, or via subprocess.Popen() or os.system()) will > >use the Python interpreter associated with the .py extension. If > >PYTHONHOME and/or PYTHONPATH refer to a different version, it will > >break. > > is it possible to test which python interpreter is associated with the > .py-extension? Create a Python script (with a .py extension) which prints useful information (e.g. sys.prefix, sys.path, sys.version, etc), then "execute" it via any native interface, e.g. system() in C, os.system() or subprocess.Popen(..., shell=True) in Python, or "cmd /c ..." from a shell script. The "sys" module is part of the main Python DLL, so it isn't affected by PYTHONHOME and PYTHONPATH. -- Glynn Clements <gl...@gclements.plus.com> ------------------------------ Message: 2 Date: Fri, 21 Oct 2011 11:37:05 -0700 (PDT) From: Helmut Kudrnovsky <hel...@web.de> Subject: [GRASS-windows] Re: r.basin for windows [was Re: WinGrass6.5.svn-installer with selected addons] To: grass-windows@lists.osgeo.org Message-ID: <1319222225309-6918034.p...@n2.nabble.com> Content-Type: text/plain; charset=us-ascii Glynn Clements: >> why is then the wxgui working normally? > >The wx GUI is invoked via $GRASS_PYTHON. > >This was originally done because the wx GUI contained binary modules >(vdigit and nviz) which would only work with the specific version of >the Python interpreter for which they were compiled. I've tried all this above with a corresponding r.basin.bat, r.wf.bat and r.ipso.bat in C:\Program Files\GRASS 6.5.SVN\bin (the python-scripts r.basin.py, r.wf.py, r.ipso.py are in C:\Program Files\GRASS 6.5.SVN\scripts). but I'm not sure the content of r.basin.bat should @"%GRASS_PYTHON%" "%GISBASE%\scripts\r.basin.py" %* or @"%GRASS_PYTHON%" "%GISBASE%/scripts/r.basin.py" %* >> is it possible to test which python interpreter is associated with the >> .py-extension? > >Create a Python script (with a .py extension) which prints useful >information (e.g. sys.prefix, sys.path, sys.version, etc), then >"execute" it via any native interface, e.g. system() in C, os.system() >or subprocess.Popen(..., shell=True) in Python, or "cmd /c ..." from a >shell script. > >The "sys" module is part of the main Python DLL, so it isn't affected >by PYTHONHOME and PYTHONPATH. my little python-testscript is: testpython.py #!/usr/bin/env python import sys print sys.prefix print print sys.path print print sys.version (1) in the wingrass-msys-shell within a grass-session: GRASS 6.5> echo $PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY GRASS 6.5> echo $PYTHONPATH /C/Program Files/GRASS 6.5.SVN/etc/python:/C/Program Files/GRASS 6.5.SVN/etc/python:/C/Program Files/GRASS 6.5.SVN/Python25: GRASS 6.5> echo $PYTHONHOME C:\Program Files\GRASS 6.5.SVN\Python25 GRASS 6.5> testpython.py C:\Program Files\GRASS 6.5.SVN\Python25 ['c:\\Users\\syringia', 'c:\\Program Files\\GRASS 6.5.SVN\\etc\\python', 'c:\\Program Files\\GRASS 6.5.SVN\\Python25', 'c:\\Program Files\\GRASS 6.5.SVN\\extralib\\python25.zip', 'C:\\Program Files\\GRASS 6.5.SVN\\Python25\\DLLs', 'C:\\Program Files\\GRASS 6.5.SVN\\Python25\\lib', 'C:\\Program Files\\GRASS 6.5.SVN\\Python25\\lib\\plat-win', 'C:\\Program Files\\GRASS 6.5.SVN\\Python25\\lib\\lib-tk', 'c:\\Program Files\\GRASS 6.5.SVN\\extrabin', 'C:\\Program Files\\GRASS 6.5.SVN\\Python25\\lib\\site-packages', 'C:\\Program Files\\GRASS 6.5.SVN\\Python25\\lib\\site-packages\\win32', 'C:\\Program Files\\GRASS 6.5.SVN\\Python25\\lib\\site-packages\\win32\\lib', 'C:\\Program Files\\GRASS 6.5.SVN\\Python25\\lib\\site-packages\\Pythonwin', 'C:\\Program Files\\GRASS 6.5.SVN\\Python25\\lib\\site-packages\\wx-2.8-msw-unicode'] 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] (2) in a windows command line outside any grass-session: C:\Users\syringia>echo %PATHEXT% .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC C:\Users\syringia>testpython.py C:\Python26\ArcGIS10.0 ['C:\\Users\\syringia', 'C:\\windows\\system32\\python26.zip', 'C:\\Python26\\ArcGIS10.0\\DLLs', 'C:\\Python26\\ArcGIS10.0\\lib', 'C:\\Python26\\ArcGIS10.0\\lib\\plat-win', 'C:\\Python26\\ArcGIS10.0\\lib\\lib-tk', 'C:\\Python26\\ArcGIS10.0', 'C:\\Python26\\ArcGIS10.0\\lib\\site-packages', 'C:\\Program Files\\ArcGIS\\Desktop10.0\\bin', 'C:\\Program Files\\ArcGIS\\Desktop10.0\\arcpy', 'C:\\Program Files\\ArcGIS\\Desktop10.0\\ArcToolbox\\Scripts'] 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)] any mixing of the different python versions within the grass-session? Helmut -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/WinGrass6-5-svn-installer-with-selected-addons-tp6873977p6918034.html Sent from the Grass - Win mailing list archive at Nabble.com. ------------------------------ _______________________________________________ grass-windows mailing list grass-windows@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-windows End of grass-windows Digest, Vol 60, Issue 18 *********************************************