[GRASS-windows] Python collections module

Luigi Ponti lponti at infinito.it
Tue Feb 9 05:23:13 EST 2010


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" <glynn at gclements.plus.com>
> Sent: Monday, February 08, 2010 9:11 PM
> To: "Frank Broniewski" <brfr at metrico.lu>
> Cc: "grass-windows" <grass-windows at 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 <glynn at gclements.plus.com> 
>
> _______________________________________________
> grass-windows mailing list
> grass-windows at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-windows
>



More information about the grass-windows mailing list