[GRASS-dev] [GRASS GIS] #2968: g.extension problem with module containing various python files: "ImportError: No module named"

#2968: g.extension problem with module containing various python files:
"ImportError: No module named"
-------------------------+-------------------------
Reporter: lrntct | Owner: grass-dev@…
     Type: defect | Status: new
Priority: major | Milestone: 7.0.4
Component: Addons | Version: svn-trunk
Keywords: g.extension | CPU: x86-64
Platform: Linux |
-------------------------+-------------------------
I encounter an error while trying to install r.agent:
{{{
Fetching <r.agent> from GRASS GIS Addons repository (be patient)...
Compiling...
Traceback (most recent call last):
   File "/tmp/grass7-laurent-26795/tmpSuOPAa/r.agent/scripts/r.agent.aco",
line 234, in <module>
     import error, grassland, anthill
ImportError: No module named error
make[1]: *** [r.agent.aco.tmp.html] Error 1
/bin/sh: 1: cannot create /usr/lib/grass71/error.log: Permission denied
make: *** [r.agent.aco] Error 2
ERROR: Compilation failed, sorry. Please check above error messages.
}}}

The same error occurs while trying to install v.class.ml (although it
worked once, but then stopped working):
{{{
Fetching <v.class.ml> from GRASS GIS Addons repository (be patient)...
Compiling...
Traceback (most recent call last):
   File
"/tmp/grass7-laurent-26795/tmpZf46jp/v.class.ml/scripts/v.class.ml", line
386, in <module>
     from training_extraction import extract_training
ImportError: No module named training_extraction
make: *** [v.class.ml.tmp.html] Error 1
ERROR: Compilation failed, sorry. Please check above error messages.
}}}

It seems to be related to python modules that includes several python
files.
I encounter the same problem with a module of mine(cf.
https://lists.osgeo.org/pipermail/grass-dev/2016-March/079481.html)

Meanwhile, v.in.wfs2 installation goes well, although its Makefile is very
similar to v.class.ml.

It might be related to :
#2480 #2534 #2865

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2968&gt;
GRASS GIS <https://grass.osgeo.org>

#2968: g.extension problem with module containing various python files:
"ImportError: No module named"
---------------------+-------------------------
  Reporter: lrntct | Owner: martinl
      Type: defect | Status: assigned
  Priority: major | Milestone: 7.0.4
Component: Addons | Version: svn-trunk
Resolution: | Keywords: g.extension
       CPU: x86-64 | Platform: Linux
---------------------+-------------------------
Changes (by martinl):

* owner: grass-dev@… => martinl
* cc: grass-dev@… (added)
* status: new => assigned

Comment:

Please try r68156 (trunk)

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2968#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#2968: g.extension problem with module containing various python files:
"ImportError: No module named"
---------------------+-------------------------
  Reporter: lrntct | Owner: martinl
      Type: defect | Status: assigned
  Priority: major | Milestone: 7.0.4
Component: Addons | Version: svn-trunk
Resolution: | Keywords: g.extension
       CPU: x86-64 | Platform: Linux
---------------------+-------------------------

Comment (by lrntct):

Replying to [comment:1 martinl]:
> Please try r68156 (trunk)

Thanks for your help. I just tried it and v.class.ml and r.agent still
fail to install with same errors.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2968#comment:2&gt;
GRASS GIS <https://grass.osgeo.org>

#2968: g.extension problem with module containing various python files:
"ImportError: No module named"
---------------------+-------------------------
  Reporter: lrntct | Owner: martinl
      Type: defect | Status: assigned
  Priority: major | Milestone: 7.0.4
Component: Addons | Version: svn-trunk
Resolution: | Keywords: g.extension
       CPU: x86-64 | Platform: Linux
---------------------+-------------------------

Comment (by lrntct):

Removing `~.grass7/addons` solved the problem for v.class ml (see #2480),
but r.agent still fail:
{{{
Fetching <r.agent> from GRASS GIS Addons repository (be patient)...
Compiling...
Traceback (most recent call last):
   File "/tmp/grass7-laurent-14181/tmplbTgeR/r.agent/scripts/r.agent.aco",
line 234, in <module>
     import error, grassland, anthill
ImportError: No module named error
make[1]: *** [r.agent.aco.tmp.html] Error 1
/bin/sh: 1: cannot create /usr/lib/grass71/error.log: Permission denied
make: *** [r.agent.aco] Error 2
ERROR: Compilation failed, sorry. Please check above error messages.
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2968#comment:3&gt;
GRASS GIS <https://grass.osgeo.org>

#2968: g.extension problem with module containing various python files:
"ImportError: No module named"
---------------------+-------------------------
  Reporter: lrntct | Owner: martinl
      Type: defect | Status: assigned
  Priority: major | Milestone: 7.0.5
Component: Addons | Version: svn-trunk
Resolution: | Keywords: g.extension
       CPU: x86-64 | Platform: Linux
---------------------+-------------------------

Comment (by neteler):

See also #2865 for a similar issue

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2968#comment:5&gt;
GRASS GIS <https://grass.osgeo.org>

#2968: g.extension problem with module containing various python files:
"ImportError: No module named"
---------------------+-------------------------
  Reporter: lrntct | Owner: martinl
      Type: defect | Status: closed
  Priority: major | Milestone: 7.0.5
Component: Addons | Version: svn-trunk
Resolution: fixed | Keywords: g.extension
       CPU: x86-64 | Platform: Linux
---------------------+-------------------------
Changes (by martinl):

* status: assigned => closed
* resolution: => fixed

Comment:

Since r69193 r.agent is installed by g.extension properly. Also v.class.ml
can be installed successfully. I am taking liberty to close this ticket.
Feel free to re-open if needed. See #2480

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2968#comment:6&gt;
GRASS GIS <https://grass.osgeo.org>