python and ubuntu's environment
Tung Thanh
con500thoi at yahoo.com
Tue Jul 23 13:14:03 UTC 2013
Thank Patrick
my python version is
mycrt009:~$ python
Python 2.6.8 (default, Apr 26 2013, 16:32:35)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
and Grass version is
>>> import sys
>>> print sys.path
['', '/usr/local/grass-6.4.3svn/scripts', '/usr/local/grass-6.4.3svn/etc/python', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload', '/usr/local/lib/python2.6/dist-packages', '/usr/lib/python2.6/dist-packages']
>>> python
I tried import grass script, It is fine..example
:~$ python
Python 2.6.8 (default, Apr 26 2013, 16:32:35)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import grass.script as g
>>> g.run_command("g.list", flags="f", type="rast,vect")
0
>>>
BUt when I tried to call web service by Curl, It says "in <module>import grass.script as grassImportError: No module named
> grass.script"
And all of my folder It puted in new user (username) I create new username by $> adduser mywps
and all the folder such as
home -
mywps
tomcat (hosting my wps service)
grass_python
data
I hope it is clear for you to see what my problem is
Many thanks
T.X.Tung
________________________________
From: Patrick Asselman <iceblink at seti.nl>
To: ubuntu-users at lists.ubuntu.com
Sent: Tuesday, July 23, 2013 2:57 PM
Subject: Re: python and ubuntu's environment
On 2013-07-23 14:00, Tung Thanh wrote:
> Hello list
>
> Thank you for all useful answer, I have stuck about (may be basic
> problem)
> I am trying to using pywps for ruing small mode in order to calculate
> raster
> I need Grass, I have already configure GRASS environment (in
> ~/.bash_profile)locally and I works
> but when I try to call WPS from the remote computer or event using
> curl
> example
>
> host_name:curl '127.0.0.1:8090/wps/WebProcessingService/xxxxxxx'
>
> but Grass environment doesn't work and it said that
>
> in <module>import grass.script as grassImportError: No module named
> grass.script
>
> Please help me to solve this kind of problem
>
> Many thanks
Your grass.script is not found by Python, for whatever reason.
Have you logged out and logged back in after editing your .bash_profile
file?
What commands are you running exactly?
What output do they give?
What does your Python code look like?
And what makes you think this is related to Ubuntu?
Best regards,
Patrick Asselman
--
ubuntu-users mailing list
ubuntu-users at lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20130723/19606df2/attachment.html>
More information about the ubuntu-users
mailing list