[GRASS-user] Running Python scripts inside GRASS

Glynn Clements glynn at gclements.plus.com
Mon Mar 8 17:38:23 EST 2010


Sonja Jankowfsky wrote:

> I uninstalled Python25 and 24 on my machine and reinstalled Python26 + 
> the packages wxPython,
> 
> PyWin32, and NumPy. 
> 
> the ftype python.file in the command line changed to Python26 now. 
> However, when I try to run the python script in GRASS I still get the following error:
> 
>  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>

So you didn't remove the one version of Python which should have been
removed, i.e. C:\GRASS-4-SVN\Python25.

You should delete this directory, and change any environment variables
which refer to it to refer to the system version of Python (e.g. 
C:\Python26 or C:\Program Files\Python26) instead.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-user mailing list