Bug #5178

Under Ubuntu 10.04 LTS plugin keep asking for package "sp"

Added by Giovanni Manghi about 1 year ago. Updated about 1 year ago.

Status:New Start Date:03/14/2012
Priority:Low Due date:
Assigned to:Anne Ghisla % Done:

0%

Category:-
Target version:-
Must fix: Resolution:
Platform: Patch supplied:No
Platform version: Causes crash or corruption:No
Status info:

Description

Even if the package is correctly installed. Upgrading to 10.10 solves the problem. R libraries installed with the cran2deb repository.

47.png (202.5 kB) Giovanni Manghi, 03/14/2012 12:01 pm

History

Updated by Giovanni Manghi about 1 year ago

PS
R version 2.10 under both Ubuntu 10.04 and 10.10

Updated by Giovanni Manghi about 1 year ago

  • Causes crash or corruption set to No

Giovanni Manghi wrote:

PS R version 2.10 under both Ubuntu 10.04 and 10.10

sorry, under Ubuntu 10.10 (where the plugin works fine) R version is 2.11.1

Updated by Anne Ghisla about 1 year ago

Hello Giovanni,

can you try this code in QGIS python console?

import rpy2.robjects as ro
ro.r.require("sp")
ro.r.require("sp")[0]

The first output should be a Python object, second should be True.

It's also worth trying if you can load other packages, and load sp from ManageR.

Thanks for feedback,
Anne

Updated by Giovanni Manghi about 1 year ago

Hi Anne, I guess we have the answer

import rpy2.robjects as ro ro.r.require("sp")
Loading required package: sp
Error in importIntoEnv(impenv, impnames, ns, impvars) :
object '‘as.raster’' is not exported by 'namespace:grDevices'
In addition: Warning message:
package 'sp' was built under R version 2.11.0
<RVector - Python:0xa341c4c / R:0x93a1f48>

so, the package "sp" in the cran2deb repo was built with R 2.11 and it won't work under Ubuntu 10.04. I tried to install the sp/rgdal packages from the R console but it gave me a bunch of "installation of package 'rgdal' had non-zero exit status" so I give up.

I then updated R to 2.14 using the CRAN repo, and what I get now is

An error has occured while executing Python code:

Traceback (most recent call last):
File "/home/gio/.qgis/python/plugins/HomeRange_plugin/HRplugin_dialog.py", line 80, in
QObject.connect(self.buttonBox, SIGNAL"), lambda mth=mth: self.run(mth))
File "/home/gio/.qgis/python/plugins/HomeRange_plugin/HRplugin_dialog.py", line 186, in run
if not robjects.r.require(i)[0]:
NameError: global name 'robjects' is not defined

Also available in: Atom PDF