Ticket #1619 (new defect)

Opened 14 months ago

Last modified 8 months ago

v.krige won't load: ImportError: No module named globalvar

Reported by: momsen Owned by: grass-dev@…
Priority: normal Milestone: 7.0.0
Component: Default Version: svn-trunk
Keywords: krige Cc: aghisla
Platform: Linux CPU: x86-64

Description

Hello, I have installed GRASS 7 this week, along with gdal/geos/spgrass6/etc. I'm on a Debian system. R and many of the dependencies came from Debian packages. But gdal and GRASS I installed from source.

v.krige gives the following errors. R/spgrass6 does work, I used readVECT6 and readRAST6 to load data into R.

Is there something else I should install/change on my side, or is this a bug?

v.krige                                                                         
Loading dependencies, please wait...
rgeos: (SVN revision 326)
 GEOS runtime version: 3.3.1-CAPI-1.7.1 
 Polygon checking: TRUE 
 WARNING! if you turn polygon checking off, and polygons are
 not valid in GEOS, you risk losing data as your R session may crash! 
Loading required package: zoo
Attaching package: ‘zoo’
The following object(s) are masked from ‘package:base’:
    as.Date, as.Date.numeric
Loading required package: xts
GRASS GIS interface loaded with GRASS version: GRASS 7.0.svn (2012)
and location: spearfish70
Checking rgeos availability: TRUE
Traceback (most recent call last):
  File "/usr/local/grass-7.0.svn/scripts/v.krige", line 411,
in <module>
    main()
  File "/usr/local/grass-7.0.svn/scripts/v.krige", line 299,
in main
    import globalvar
ImportError: No module named globalvar
(Thu Mar 15 14:55:17 2012) Command finished (1 sec)                             
(Thu Mar 15 15:43:42 2012)                                                      
g.gisenv -n                                                                     
LOCATION_NAME=spearfish70
GISDBASE=/home/emomsen/GRASSDATA
MAPSET=user1
GUI=wxpython

I tried loading the R package dependencies I knew about in R, that seemed to be a common theme in previous v.krige errors. I think I have everything installed.

> sessionInfo()
R version 2.14.1 (2011-12-22)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=C                 LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] maptools_0.8-14 lattice_0.20-0  foreign_0.8-49  automap_1.0-12 
 [5] gstat_1.0-10    spacetime_0.6-0 rgeos_0.2-3     stringr_0.6    
 [9] xts_0.8-2       zoo_1.7-7       spgrass6_0.7-9  XML_3.9-4      
[13] sp_0.9-97      

loaded via a namespace (and not attached):
[1] grid_2.14.1 plyr_1.7.1 

Other dependencies:

emomsen@gis-dev-test:/usr/local/grass-7.0.svn/scripts$ aptitude search rpy2
i   python-rpy2                                       - Python interface to the GNU R language and environment (ver
v   python2.6-rpy2                                    -                                                            
v   python2.7-rpy2                                    -                                                            

Anything I should normally be reporting? I checked the subversion number:

root@gis-dev-test:/opt/grass_trunk# svn info
Path: .
URL: https://svn.osgeo.org/grass/grass/trunk
Repository Root: https://svn.osgeo.org/grass
Repository UUID: 15284696-431f-4ddb-bdfa-cd5b030d7da7
Revision: 51063
Node Kind: directory
Schedule: normal
Last Changed Author: martinl
Last Changed Rev: 51060
Last Changed Date: 2012-03-14 17:13:32 -0500 (Wed, 14 Mar 2012)

Thanks for any help!

Change History

  Changed 14 months ago by aghisla

Hello momsen,

thanks for the well detailed report.

v.krige is not aware of last GUI reorganisations, so it can't load properly, as stated by the traceback:

ImportError?: No module named globalvar

So far I didn't find the time to update the module. If you are willing to help, let me know.

Moreover, the module should not require zoo and xts packages. I can't see them as dependencies of the modules needed by v.krige, that are:

rgeos, gstat, spgrass6, maptools

Can you load these packages in a R session?

Thanks for the feedback, Anne

  Changed 14 months ago by momsen

It is nice to hear I've finally gotten to the point where my installation wasn't at fault. I have not yet updated/written code for any open source projects, but want to learn. I have a presentation Tuesday, so if someone can provide guidance I could look at it then. If you find time to make the update before that, I'm sure there will be other things I can help with later.

I'm late for leaving for the weekend, I'll be able to check more on zoo and xts later. Both can be loaded directly in R as well, from memory zoo was a dependency for one of the spgrass6 related packages. At least it shows up each time I installed it!

-Eric

in reply to: ↑ description   Changed 14 months ago by momsen

I am able to load rgeos, gstat, spgrass6, and maptools in a R session.

I found where zoo and xts came from:

automap is optional (provides automatic variogram fit) for v.krige. automap depends on gstat, which depends on spacetime, which depends on zoo and xts.

-Eric

  Changed 8 months ago by neteler

  • cc aghisla added

Startup problems fixed in r53127.

Remaining issue: creating the variogram leads to

Traceback (most recent call last):
  File "/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/etc/gui/wxpython/scripts/vkrige.py", line 444, in OnPlotButton
    if globals()["InputData"] is None:
KeyError: 'InputData'
Traceback (most recent call last):
  File "/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/etc/gui/wxpython/scripts/vkrige.py", line 444, in OnPlotButton
    if globals()["InputData"] is None:
KeyError: 'InputData'
Traceback (most recent call last):
  File "/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/etc/gui/wxpython/scripts/vkrige.py", line 256, in OnRunButton
    self.goutput.RunCmd(command, switchPage = True)
  File "/home/neteler/grass70/dist.x86_64-unknown-linux-gnu/etc/gui/wxpython/gui_core/goutput.py", line 604, in RunCmd
    self._notebook.SetSelectionByName('output')
AttributeError: 'FlatNotebook' object has no attribute 'SetSelectionByName'

follow-up: ↓ 6   Changed 8 months ago by annakrat

I can fix the FlatNotebook? part of error (probably tomorrow, I must first download some packages to be able to test it).

Anna

in reply to: ↑ 5   Changed 8 months ago by annakrat

Replying to annakrat:

I can fix the FlatNotebook? part of error (probably tomorrow, I must first download some packages to be able to test it).

After installation of needed packages I get this error:

GRASS 7.0.svn (spearfish60):/usr/local/src/trunk > v.krige
Loading dependencies, please wait...
rgeos: (SVN revision 348)
 GEOS runtime version: 3.3.3-CAPI-1.7.4 
 Polygon checking: TRUE 

Loading required package: zoo

Attaching package: ‘zoo’

The following object(s) are masked from ‘package:base’:

    as.Date, as.Date.numeric

Loading required package: xts
GRASS GIS interface loaded with GRASS version: GRASS 7.0.svn (2012)
and location: spearfish60
Checking rgeos availability: TRUE
Loading required package: automap
Traceback (most recent call last):
  File "/usr/local/src/trunk/dist.i686-pc-linux-gnu/scripts/v.krige", line 414, in <module>
    main()
  File "/usr/local/src/trunk/dist.i686-pc-linux-gnu/scripts/v.krige", line 312, in main
    controller = controller)
  File "/usr/local/src/trunk/dist.i686-pc-linux-gnu/etc/gui/wxpython/scripts/vkrige.py", line 269, in __init__
    self.Panel = KrigingPanel(self, Rinstance, controller)
  File "/usr/local/src/trunk/dist.i686-pc-linux-gnu/etc/gui/wxpython/scripts/vkrige.py", line 98, in __init__
    self.CreatePage(package = Rpackage, Rinstance = Rinstance, controller = controller)
  File "/usr/local/src/trunk/dist.i686-pc-linux-gnu/etc/gui/wxpython/scripts/vkrige.py", line 175, in CreatePage
    controller = controller)))
  File "/usr/local/src/trunk/dist.i686-pc-linux-gnu/etc/gui/wxpython/scripts/vkrige.py", line 394, in __init__
    ModelFactor = robjects.r.vgm().rx('long')
AttributeError: 'RDataFrame' object has no attribute 'rx'

I have no idea what rx is or how too fix this.

Anna

  Changed 8 months ago by annakrat

The problem with notebook should be fixed in r53148. Anna

  Changed 8 months ago by neteler

One more fix done in r53149.

  Changed 8 months ago by neteler

For now v.krige is commented out in the parent Makefile, see r53194.

Note: See TracTickets for help on using tickets.