[GRASS-user] PyGRASS: No such file or directory using Module

Hello everyone,

I am trying to use PyGRASS following the example scripts at the Wiki:

https://grasswiki.osgeo.org/wiki/GRASS_and_Python#pygrass_Library

But on each call to the Module method I get a “No such file or directory” error (reproduced below). This is an issue with the call to Popen, but I can not tell if its related to this method itself or to the GRASS modules.

Any ideas on what may be going wrong? Thank you,

Luís

OSError error(2): No such file or directory

Traceback (most recent call last):

File “/home/desouslu/git/pywps-4-demo/processes/pygrass-demo4.py”, line 29, in

ogrimport = Module(‘v.in.ogr’)

File “/usr/lib/grass70/etc/python/grass/pygrass/modules/interface/module.py”, line 466, in init

raise GrassError(str_err % self.name)

grass.exceptions.GrassError: Error running: v.in.ogr --interface-description.

On Tue, Jun 21, 2016 at 8:20 AM, Luí­s de Sousa
<luis.de.sousa@protonmail.ch> wrote:

Hello everyone,

I am trying to use PyGRASS following the example scripts at the Wiki:
https://grasswiki.osgeo.org/wiki/GRASS_and_Python#pygrass_Library

But on each call to the Module method I get a "No such file or directory"
error (reproduced below). This is an issue with the call to Popen, but I can
not tell if its related to this method itself or to the GRASS modules.

Any ideas on what may be going wrong? Thank you,

Luís

OSError error(2): No such file or directory
Traceback (most recent call last):
  File "/home/desouslu/git/pywps-4-demo/processes/pygrass-demo4.py", line
29, in <module>
    ogrimport = Module('v.in.ogr')
  File
"/usr/lib/grass70/etc/python/grass/pygrass/modules/interface/module.py",
line 466, in __init__
    raise GrassError(str_err % self.name)
grass.exceptions.GrassError: Error running: `v.in.ogr
--interface-description`.

Are you running this in a GRASS GIS session? Technically that is not
much more than setting some environment variables (see Wiki).

Markus

Hi Markus, thank you for replying.

The LD_LIBRARY_PATH environment variable was not correctly set up at run time. All the required variables must be set session wide before firing up the interpreter and I was not aware of it.

Regards,

Luís

···

-------- Original Message --------

Subject: Re: [GRASS-user] PyGRASS: No such file or directory using Module

Local Time: 23 June 2016 7:08 PM

UTC Time: 23 June 2016 17:08

From: neteler@osgeo.org

To: luis.de.sousa@protonmail.ch

CC: grass-user@lists.osgeo.org

On Tue, Jun 21, 2016 at 8:20 AM, Luí­s de Sousa

luis.de.sousa@protonmail.ch wrote:

Hello everyone,

I am trying to use PyGRASS following the example scripts at the Wiki:

https://grasswiki.osgeo.org/wiki/GRASS_and_Python#pygrass_Library

But on each call to the Module method I get a “No such file or directory”

error (reproduced below). This is an issue with the call to Popen, but I can

not tell if its related to this method itself or to the GRASS modules.

Any ideas on what may be going wrong? Thank you,

Luís

OSError error(2): No such file or directory

Traceback (most recent call last):

File “/home/desouslu/git/pywps-4-demo/processes/pygrass-demo4.py”, line

29, in

ogrimport = Module(‘v.in.ogr’)

File

“/usr/lib/grass70/etc/python/grass/pygrass/modules/interface/module.py”,

line 466, in init

raise GrassError(str_err % self.name)

grass.exceptions.GrassError: Error running: `v.in.ogr

–interface-description`.

Are you running this in a GRASS GIS session? Technically that is not

much more than setting some environment variables (see Wiki).

Markus