[GRASS-dev] [GRASS GIS] #2480: v.class.ml: ImportError: No module named training_extraction

#2480: v.class.ml: ImportError: No module named training_extraction
------------------------------------+---------------------------------------
Reporter: mlennert | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone:
Component: Addons | Version: svn-releasebranch70
Keywords: v.class.ml g.extension | Platform: Unspecified
      Cpu: Unspecified |
------------------------------------+---------------------------------------
Using g.extension to install v.class.ml in a fresh grass70release compile,
I get:

{{{
g.extension extension=v.class.ml svnurl=http://svn.osgeo.org/grass/grass-
addons/grass7
Fetching <v.class.ml> from GRASS-Addons SVN repository (be patient)...
Compiling...
Traceback (most recent call last):
   File "/tmp/tmpj4o0hW/v.class.ml/scripts/v.class.ml", line
375, 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.
}}}

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

#2480: v.class.ml: ImportError: No module named training_extraction
------------------------------------+---------------------------------------
Reporter: mlennert | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone:
Component: Addons | Version: svn-releasebranch70
Keywords: v.class.ml g.extension | Platform: Unspecified
      Cpu: Unspecified |
------------------------------------+---------------------------------------

Comment(by mlennert):

To complete, compiling from the grass-addons tree works fine;

{{{
~/SRC/GRASS/grass-addons/grass7/vector/v.class.ml > make
MODULE_TOPDIR=~/SRC/GRASS/grass70release/dist.x86_64-unknown-linux-gnu/
}}}

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

#2480: v.class.ml: ImportError: No module named training_extraction
------------------------------------+---------------------------------------
Reporter: mlennert | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone:
Component: Addons | Version: svn-releasebranch70
Keywords: v.class.ml g.extension | Platform: Unspecified
      Cpu: Unspecified |
------------------------------------+---------------------------------------

Comment(by nikosa):

I can't work this out. Also, I have the same, I think, problem with a new
script of mine from which I import an external .py file. Any ideas?

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

#2480: v.class.ml: ImportError: No module named training_extraction
------------------------------------+---------------------------------------
Reporter: mlennert | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone:
Component: Addons | Version: svn-releasebranch70
Keywords: v.class.ml g.extension | Platform: Unspecified
      Cpu: Unspecified |
------------------------------------+---------------------------------------

Comment(by nikosa):

I guess after cleaning old compiled stuff, and installing sklearn, all
works fine now.

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

#2480: v.class.ml: ImportError: No module named training_extraction
------------------------------------+---------------------------------------
Reporter: mlennert | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone:
Component: Addons | Version: svn-releasebranch70
Keywords: v.class.ml g.extension | Platform: Unspecified
      Cpu: Unspecified |
------------------------------------+---------------------------------------

Comment(by mlennert):

Replying to [comment:3 nikosa]:
> I guess after cleaning old compiled stuff, and installing sklearn, all
works fine now.

Could you explain what exactly you did to make it work ? Did you use
g.extension, or compiled it from a source tree on your machine ?

When I compile manually with MODULE_TOPDIR set to my source dir,
everything works fine, i.e. the main v.class.ml ends up in scripts/ and
all the additional files get copied to etc/v.class.ml/.

However, when I use g.extension, only the main script gets copied to
.grass7/addons/scripts whereas nothing is copied to .grass7/addons/etc.

Moritz

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

#2480: v.class.ml: ImportError: No module named training_extraction
------------------------------------+---------------------------------------
Reporter: mlennert | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone:
Component: Addons | Version: svn-releasebranch70
Keywords: v.class.ml g.extension | Platform: Unspecified
      Cpu: Unspecified |
------------------------------------+---------------------------------------

Comment(by nikosa):

Replying to [comment:4 mlennert]:
> Replying to [comment:3 nikosa]:
> > I guess after cleaning old compiled stuff, and installing sklearn, all
works fine now.

> Could you explain what exactly you did to make it work ? Did you use
g.extension, or compiled it from a source tree on your machine ?

I compiled from a local copy of the source tree (v.70)

> When I compile manually with MODULE_TOPDIR set to my source dir,
everything works fine, i.e. the main v.class.ml ends up in scripts/ and
all the additional files get copied to etc/v.class.ml/.
>
> However, when I use g.extension, only the main script gets copied to
.grass7/addons/scripts whereas nothing is copied to .grass7/addons/etc.

g.extension fails here too.

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

#2480: v.class.ml: ImportError: No module named training_extraction
------------------------------------+---------------------------------------
Reporter: mlennert | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone:
Component: Addons | Version: svn-releasebranch70
Keywords: v.class.ml g.extension | Platform: Unspecified
      Cpu: Unspecified |
------------------------------------+---------------------------------------

Comment(by martinl):

Replying to [comment:5 nikosa]:
> > However, when I use g.extension, only the main script gets copied to
.grass7/addons/scripts whereas nothing is copied to .grass7/addons/etc.
>
> g.extension fails here too.

please try recent version, this issue should be fixed also in g70.

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

#2480: v.class.ml: ImportError: No module named training_extraction
------------------------------------+---------------------------------------
Reporter: mlennert | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone:
Component: Addons | Version: svn-releasebranch70
Keywords: v.class.ml g.extension | Platform: Unspecified
      Cpu: Unspecified |
------------------------------------+---------------------------------------

Comment(by mlennert):

Replying to [comment:6 martinl]:
> Replying to [comment:5 nikosa]:
> > > However, when I use g.extension, only the main script gets copied to
.grass7/addons/scripts whereas nothing is copied to .grass7/addons/etc.
> >
> > g.extension fails here too.
>
> please try recent version, this issue should be fixed also in g70.

Trunk, make distcleaned, updated, and compiled yesterday (r63985):

{{{
g.extension extension=v.class.ml svnurl=http://svn.osgeo.org/grass/grass-
addons/grass7
Fetching <v.class.ml> from GRASS-Addons SVN repository (be patient)...
Compiling...
Traceback (most recent call last):
   File "/tmp/tmpJCQjBq/v.class.ml/scripts/v.class.ml", line
387, 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.
}}}

Moritz

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

#2480: v.class.ml: ImportError: No module named training_extraction
------------------------------------+---------------------------------------
Reporter: mlennert | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Addons | Version: svn-releasebranch70
Keywords: v.class.ml g.extension | Platform: Unspecified
      Cpu: Unspecified |
------------------------------------+---------------------------------------
Changes (by mlennert):

  * milestone: => 7.0.0

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

#2480: v.class.ml: ImportError: No module named training_extraction
--------------------------+------------------------------------
  Reporter: mlennert | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.0.0
Component: Addons | Version: svn-releasebranch70
Resolution: | Keywords: v.class.ml g.extension
       CPU: Unspecified | Platform: Unspecified
--------------------------+------------------------------------

Comment (by nikosa):

Any news for this one? I have the same problem when tryin to compile
i.segment.hierarchical ([http://trac.osgeo.org/grass/ticket/2534 #2534])
and a new script of mine as well.

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