[GRASS-dev] pygrass v.import_() strange error
Yann Chemin
dr.yann.chemin at gmail.com
Thu Aug 2 03:16:58 PDT 2018
yes in the meantime I am running it with parse_command I believe
#code######################################################
from grass_session import Session
from grass.script import core as gcore
#from grass.pygrass.modules.shortcuts import vector as v
with Session(gisdb="/tmp", location="loc", create_opts="EPSG:4326"):
#v.import_(input=adminfile,output="admin",quiet=True,superquiet=True)
gcore.parse_command("v.import",input=adminfile,output="admin",quiet=True)
On Wed, 25 Jul 2018 at 11:05, Nikos Alexandris <nik at nikosalexandris.net>
wrote:
> * Yann Chemin <dr.yann.chemin at gmail.com> [2018-07-25 09:34:32 +0200]:
>
> >Hi,
> >(script below)
> >I get this error
> >
> >v.import_(input=adminfile,output="admin",quiet=True,superquiet=True)
> > File "/usr/lib/grass74/etc/python/grass/pygrass/modules/shortcuts.py",
> >line 47, in __getattr__
> > return self.cls('%s.%s' % (self.prefix, name.replace('_', '.')))
> > File
> >"/usr/lib/grass74/etc/python/grass/pygrass/modules/interface/module.py",
> >line 530, in __init__
> > raise GrassError(str_err % self.name)
> >grass.exceptions.GrassError: Error running: `v.import.
> >--interface-description`.
> >
> >#SCRIPT
> >from grass_session import Session
> >from grass.pygrass.modules.shortcuts import vector as v
> >adminfile=gadm_FR_2_Morbihan.gpkg
> >with Session(gisdb="/tmp", location="loc", create_opts="EPSG:4326"):
> > v.import_(input=adminfile,output="admin",quiet=True,superquiet=True)
>
> Yann,
>
> does the "typical"
>
> grass.run_command('v.import', input=adminfile, output="admin", quiet=True,
> superquiet=True)
>
> work?
>
> Nikos
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20180802/85fb6128/attachment-0001.html>
More information about the grass-dev
mailing list