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: Python collections module (Frank Broniewski) 2. Re: Python collections module (Luigi Ponti) 3. Re: [GRASS-user] Language of installed manual (Luigi Ponti) ---------------------------------------------------------------------- Message: 1 Date: Wed, 10 Feb 2010 07:45:26 +0100 From: "Frank Broniewski" <b...@metrico.lu> Subject: Re: [GRASS-windows] Python collections module To: "Luigi Ponti" <lpo...@infinito.it> Cc: Glynn Clements <gl...@gclements.plus.com>, grass-windows <grass-windows@lists.osgeo.org> Message-ID: <c5d261959b75462fa5fbd200a641f...@pcfl01brfr> Content-Type: text/plain; format=flowed; charset="ISO-8859-3"; reply-type=response Hello Luigi, It seems that your python path is not set. You get yet a different error because of this. In your case your test.py should set it accordingly like so: import sys import os #Try to import GRASS GIS Python module if "GISBASE" in os.environ: osgeo4w_root = os.path.normpath(os.environ["OSGEO4W_ROOT"]) gis_base = os.path.normpath(os.environ["GISBASE"]) grass_python_path = os.path.join(gis_base, "etc", "python") std_python_path = os.path.join(osgeo4w_root, "apps", "Python25", "Lib") sys.path.append(grass_python_path) sys.path.append(std_python_path) if "PYTHONPATH" not in os.environ: os.environ["PYTHONPATH"] = grass_python_path + os.pathsep + std_python_path try: import grass.script as grass except ImportError: print os.environ["PYTHONPATH"] This code sets the PYTHONPATH environment variable to your grass gis installation directory. If you could execute that code again. If you get my mentioned error or nothing at all the code works. I hope this isn't too much trouble Many thanks Frank -------------------------------------------------- From: "Luigi Ponti" <lpo...@infinito.it> Sent: Tuesday, February 09, 2010 11:23 AM To: "Frank Broniewski" <b...@metrico.lu> Cc: "Glynn Clements" <gl...@gclements.plus.com>; "grass-windows" <grass-windows@lists.osgeo.org> Subject: Re: [GRASS-windows] Python collections module > On 09/02/2010 08:03, Frank Broniewski wrote: >> Hello, >> >> Thanks for your answer, Glynn. I don't find a python25.dll in my stock >> installation, but it works too. I am just a little bit worried that the >> shipped version from the osgeo4w installer doesn't work as expected. When >> I replace the osgeo4w version with the stock version everything works. >> >> Can someone confirm this? Sample code to reproduce my error: >> test.py >> -------------- >> import sys >> import os >> import grass.script as grass >> >> gives me the below mentioned error. It's because >> Python25/Lib/threading.py does: >> from collections import deque. > Hi, > > This is what I get on my osgeo4w grass: > > GRASS 6.4.0svn (AEA_US)> python --version > Python 2.5.2 > > GRASS 6.4.0svn (AEA_US)> python test.py > Traceback (most recent call last): > File "test.py", line 3, in <module> > import grass.script as grass > ImportError: No module named grass.script > > Regards, > Luigi > >> >> Now I wonder if I should report this as a bug, because reinstalling >> osgeo4w doesn't solve the problem. If someone can confirm this I would >> report it, but I hesitate. I will test this behavior on another >> installation today and I will see if I encounter this error message >> again. >> >> Many thanks >> >> Frank >> >> -------------------------------------------------- >> From: "Glynn Clements" <gl...@gclements.plus.com> >> Sent: Monday, February 08, 2010 9:11 PM >> To: "Frank Broniewski" <b...@metrico.lu> >> Cc: "grass-windows" <grass-windows@lists.osgeo.org> >> Subject: Re: [GRASS-windows] Python collections module >> >>> >>> Frank Broniewski wrote: >>> >>>> I am using the osgeo4w installation and I want to use the python >>>> scripting >>>> possibilities. >>>> When I try to import the grass module I get an ImportError "No module >>>> named >>>> collections" from "C:\OSGeo4W\apps\Python25\lib\threading.py". >>>> And indeed there is no collections.py. When I look into my Python26 >>>> installation dir, there is a collections.py in Python26\Lib. Is the >>>> osgeo4w >>>> python package broken? Reinstalling does not fix the missing >>>> collections >>>> module. >>>> I appreciate any help with this problem >>> >>> The Python documentation says that the collections module was added in >>> 2.4. >>> >>> I have both Python 2.5 and Python 2.6 installed on Windows (both are >>> the stock python.org versions). 2.5 doesn't have a collections.py, but >>> "import collections" works from the IDE. AFAICT, the collections >>> module is built into python25.dll. >>> >>> -- >>> Glynn Clements <gl...@gclements.plus.com> >> >> _______________________________________________ >> grass-windows mailing list >> grass-windows@lists.osgeo.org >> http://lists.osgeo.org/mailman/listinfo/grass-windows >> > ------------------------------ Message: 2 Date: Wed, 10 Feb 2010 10:41:25 +0100 From: Luigi Ponti <lpo...@infinito.it> Subject: Re: [GRASS-windows] Python collections module To: Frank Broniewski <b...@metrico.lu> Cc: Glynn Clements <gl...@gclements.plus.com>, grass-windows <grass-windows@lists.osgeo.org> Message-ID: <4b727f45.5010...@infinito.it> Content-Type: text/plain; charset=ISO-8859-3; format=flowed On 10/02/2010 07:45, Frank Broniewski wrote: > Hello Luigi, > > It seems that your python path is not set. You get yet a different > error because of this. In your case your test.py should set it > accordingly like so: > > import sys > import os > > #Try to import GRASS GIS Python module > if "GISBASE" in os.environ: > osgeo4w_root = os.path.normpath(os.environ["OSGEO4W_ROOT"]) > gis_base = os.path.normpath(os.environ["GISBASE"]) > > grass_python_path = os.path.join(gis_base, "etc", "python") > std_python_path = os.path.join(osgeo4w_root, "apps", "Python25", > "Lib") > > sys.path.append(grass_python_path) > sys.path.append(std_python_path) > > if "PYTHONPATH" not in os.environ: > os.environ["PYTHONPATH"] = grass_python_path + os.pathsep + > std_python_path > > try: > import grass.script as grass > except ImportError: > print os.environ["PYTHONPATH"] > > > This code sets the PYTHONPATH environment variable to your grass gis > installation directory. If you could execute that code again. If you > get my mentioned error or nothing at all the code works. I hope this > isn't too much trouble Hello Frank and thanks for your reply -- I am also interested in Python-scripting GRASS. (Meanwhile I have updated to the new osgeo4w grass package) Your code above seem to work -- I receive no error. Is the code above something that needs to go on top of every python/GRASS script in order for it to work? I was assuming (wrongly, at this point) that those environmental variables were supposed to be set by a startup script. As a side note, your previous little script (let us call it test.py) gives the same error on WinGRASS-6.4.SVN-r40876 (i.e. from yesterday's standalone installer): GRASS 6.4.0svn (EurLCC)> python test.py Traceback (most recent call last): File "test.py", line 3, in <module> import grass.script as grass ImportError: No module named grass.script Does it mean again python path is not set? Kind regards, Luigi > > > Many thanks > > Frank > > -------------------------------------------------- > From: "Luigi Ponti" <lpo...@infinito.it> > Sent: Tuesday, February 09, 2010 11:23 AM > To: "Frank Broniewski" <b...@metrico.lu> > Cc: "Glynn Clements" <gl...@gclements.plus.com>; "grass-windows" > <grass-windows@lists.osgeo.org> > Subject: Re: [GRASS-windows] Python collections module > >> On 09/02/2010 08:03, Frank Broniewski wrote: >>> Hello, >>> >>> Thanks for your answer, Glynn. I don't find a python25.dll in my >>> stock installation, but it works too. I am just a little bit worried >>> that the shipped version from the osgeo4w installer doesn't work as >>> expected. When I replace the osgeo4w version with the stock version >>> everything works. >>> >>> Can someone confirm this? Sample code to reproduce my error: >>> test.py >>> -------------- >>> import sys >>> import os >>> import grass.script as grass >>> >>> gives me the below mentioned error. It's because >>> Python25/Lib/threading.py does: >>> from collections import deque. >> Hi, >> >> This is what I get on my osgeo4w grass: >> >> GRASS 6.4.0svn (AEA_US)> python --version >> Python 2.5.2 >> >> GRASS 6.4.0svn (AEA_US)> python test.py >> Traceback (most recent call last): >> File "test.py", line 3, in <module> >> import grass.script as grass >> ImportError: No module named grass.script >> >> Regards, >> Luigi >> >>> >>> Now I wonder if I should report this as a bug, because reinstalling >>> osgeo4w doesn't solve the problem. If someone can confirm this I >>> would report it, but I hesitate. I will test this behavior on >>> another installation today and I will see if I encounter this error >>> message again. >>> >>> Many thanks >>> >>> Frank >>> >>> -------------------------------------------------- >>> From: "Glynn Clements" <gl...@gclements.plus.com> >>> Sent: Monday, February 08, 2010 9:11 PM >>> To: "Frank Broniewski" <b...@metrico.lu> >>> Cc: "grass-windows" <grass-windows@lists.osgeo.org> >>> Subject: Re: [GRASS-windows] Python collections module >>> >>>> >>>> Frank Broniewski wrote: >>>> >>>>> I am using the osgeo4w installation and I want to use the python >>>>> scripting >>>>> possibilities. >>>>> When I try to import the grass module I get an ImportError "No >>>>> module named >>>>> collections" from "C:\OSGeo4W\apps\Python25\lib\threading.py". >>>>> And indeed there is no collections.py. When I look into my Python26 >>>>> installation dir, there is a collections.py in Python26\Lib. Is >>>>> the osgeo4w >>>>> python package broken? Reinstalling does not fix the missing >>>>> collections >>>>> module. >>>>> I appreciate any help with this problem >>>> >>>> The Python documentation says that the collections module was added in >>>> 2.4. >>>> >>>> I have both Python 2.5 and Python 2.6 installed on Windows (both are >>>> the stock python.org versions). 2.5 doesn't have a collections.py, but >>>> "import collections" works from the IDE. AFAICT, the collections >>>> module is built into python25.dll. >>>> >>>> -- >>>> Glynn Clements <gl...@gclements.plus.com> >>> >>> _______________________________________________ >>> grass-windows mailing list >>> grass-windows@lists.osgeo.org >>> http://lists.osgeo.org/mailman/listinfo/grass-windows >>> >> > _______________________________________________ > grass-windows mailing list > grass-windows@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/grass-windows > ------------------------------ Message: 3 Date: Wed, 10 Feb 2010 11:45:04 +0100 From: Luigi Ponti <lpo...@infinito.it> Subject: [GRASS-windows] Re: [GRASS-user] Language of installed manual To: Markus Neteler <nete...@osgeo.org> Cc: GRASS user list <grass-u...@lists.osgeo.org>, Martin Landa <landa.mar...@gmail.com>, grass-windows@lists.osgeo.org Message-ID: <4b728e30.1040...@infinito.it> Content-Type: text/plain; charset="iso-8859-3" On 28/01/2010 15:51, Markus Neteler wrote: > Martin: please read on: > > On Thu, Jan 28, 2010 at 3:27 PM, Luigi Ponti <lpo...@infinito.it> wrote: > >> Hi all, >> >> Not sure why this happens, but some of the manual pages of my >> WinGRASS-6.4.SVN-r40650-1 installation are in English e.g. >> >> v.build.all - Rebuilds topology on all vector maps in the current mapset. >> >> while other are in another (not sure which) language e.g. >> >> v.buffer - Vytvoøí buffer okolo prvkù zadaného typu (plochy musí obsahovat >> centroid) >> >> Is this a known issue? >> > > It is a bugfeature: some want it some not. Ideally both English and the > current locale would be used for creating the manual, see enhancement > request: https://trac.osgeo.org/grass/ticket/846 > > Apparently winGRASS-daily was/is build in CZ locale and NLS active. > Before compilation, the locale settings should be set to English by > defining LANG and LC_MESSAGES variables. IMHO easy to fix > on Martin's server. > Hello, Just wanted to mention the partly-Czech manual is still there on the daily standalone installer (WinGRASS-6.4.SVN-r40876): many (not all) of the man pages have the first part (Flags, Parameters) in Czech, while starting from the Description section the rest of the page is in English. Kind regards, Luigi P.S. It was really a major improvement to have daily builds packaged for windows -- THANKS! > Markus > _______________________________________________ > grass-windows mailing list > grass-windows@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/grass-windows > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.osgeo.org/pipermail/grass-windows/attachments/20100210/00b5f229/attachment-0001.html ------------------------------ _______________________________________________ grass-windows mailing list grass-windows@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-windows End of grass-windows Digest, Vol 42, Issue 4 ********************************************