[GRASS-user] Re: python scripts load error

Neil_Alex neil.alexander at zoo.ox.ac.uk
Wed Jun 15 06:03:28 EDT 2011


Hi there,

*Apologies for double posting.  My original post was send before I
subscribed to the mailing list and is still pending and has not been sent to
the mailing list.  I think the Admin is away from the office at the moment,
hence this repost.*

I have been trying to set my machine up so I can run Grass commands from
Python on an Ubuntu1104 64bit system.  I have come across similar problems
listed on this site and elsewhere loading the grass.script.  But having
tried to follow the advice I still can't import the script in python.

Can anyone help!

So in the terminal I start python and run the following line of code with
the resulting error:

Python 2.7.1+ (r271:86832, Apr 11 2011, 18:13:53) 
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import grass.script as grass
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named grass.script


Having consulted the following  page on the subject:
http://grass.osgeo.org/wiki/GRASS_and_Python

I have added the following lines to my .bashrc file and restarted my system
but I still get the same error:

export GISBASE=usr/lib/grass64
export
PATH=$PATH:/home/neil/segmentation:/$GISBASE/bin:/$GISBASE/scripts:/$GISBASE/etc:/$GISBASE/lib:/usr/lib64/python2.7:/$GISBASE/etc/python/grass:/$GISBASE/etc/python/grass/lib:/$GISBASE/etc/python/grass/script
export GISRC=$HOME/.grassrc6
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GISBASE/lib
export PYTHONPATH=$GISBASE/etc/python
export PYTHONLIB=/usr/lib64/python2.7


Does anyone have any other ideas on what to try to get things working?

Many Thanks in advance.

NB. It may be worth noting that I have noticed there is also python2.6 files
on my machine in case there are other files that need checking regarding the
python path. 

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/python-scripts-load-error-tp6033724p6478127.html
Sent from the Grass - Users mailing list archive at Nabble.com.


More information about the grass-user mailing list