So, there is one good thing: I got to run my python program inside
GRASS. However, I lost the python GUI. It's good that there is still the
Tcl/Tk interface and QGIS ;-)
In detail:
Reducing the PYTHONPATH to C:\GRASS-4-SVN\etc\python changes nothing in
the error message.
However, I had a look in my python installations
(Python24,Python25,Python26 and GRASS-4-SVN/Python25) for collections.py
and this is only included in Python26.
This explains also, why my python program runs under Eclipse, as I put
Python26 into the Eclipse Path.
So, I changed the hole content of my C:\GRASS-4-SVN\Python25 directory
with the content of the C:\Python26 directory. I kept the name
(Python25) of the directory and the Scripts directory and sip.exe.
Now, I can run my Pythonprogramm under the GRASS windows command line,
however I can no longer use the Pythonwx GUI. (which does not seem
surprising due to the brutal changes I made ;-))
I don't know anything about the differences between Python25 and
Python26 and the dependencies for the wxpython GUI, but in my opinion it
would be necessary to update the WinGRASS installation with a Python26
version while keeping the compability to the wxpython GUI, in order to
be able to run the python scripts inside GRASS.
Does anybody know an easier solution?
Glynn Clements a écrit :
Sonja Jankowfsky wrote:
I'm inside a GRASS session, with my Windows GRASS Command Line and I try
to run a python script using GRASS functions:
File "E:\pythoninput\test_simple.py", line 2, in <module>
import grass.script as grass
File "C:\GRASS-4-SVN\etc\python\grass\script\__init__.py", line 1, in
<module>
from core import *
File "C:\GRASS-4-SVN\etc\python\grass\script\core.py", line 30, in
<module>
import subprocess
File "C:\GRASS-4-SVN\Python25\lib\subprocess.py", line 376, in <module>
import threading
File "C:\GRASS-4-SVN\Python25\lib\threading.py", line 13, in <module>
from collections import deque
ImportError: No module named collections
Is this an error in the PYTHONPATH? And where can I define it inside GRASS?
This indicates either a broken Python installation or broken
configuration. The collections module should be present in 2.5 (it was
added in 2.4).
From your previous message, I note:
PYTHONPATH
C:\GRASS-4-SVN\etc;C:\GRASS-4-SVN\etc\python;C:\GRASS-4-SVN\lib;C:\GRASS-4-SVN\bin;C:\GRASS-4-SVN\extralib;C:\Python26;
This is wrong. PYTHONPATH should be set to:
C:\GRASS-4-SVN\etc\python
It shouldn't contain any other directories. Python can find modules
which are part of the Python distribution without any configuration;
PYTHONPATH is only needed for the Python modules which are part of
GRASS.
--
Sonja Jankowfsky
UR Hydrologie-Hydraulique
Cemagref de Lyon
3 bis quai Chauveau CP 220
69336 Lyon Cedex 09
FRANCE
Tel : (+33)4 72 20 86 11
Fax : (+33)4 78 47 78 75
_______________________________________________
grass-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-user