[Qgis-user] Re: manageR doesn't work well

Carson Farmer carson.farmer at gmail.com
Sun May 22 06:10:57 PDT 2011


Hi Maxime,

> Im using manageR 1.0, QGIS 1.7 and 1.6 and R 1.11.0 on Windows 7
Are you sure you're using R 1.11.0? That's a pretty old version! Also,
which version of rpy2 are you using? Furthermore, I attach an email
from another manageR using with a possible solution for Windows 7
issues:

I had a problem getting ManageR to run on QGIS 1.60 (OSGeoW4 install)
with R-2.12.1 (32 bit) on Windows 7 64 bit systems. Rpy2 complained
about not finding R.dll.
Newer versions of R place the executable files in a new subdirectory,
i386, below the bin directory on Windows 7 systems.

After searching the net for a while, I finally found the following
post, which seems to fix the problem:
http://www.mail-archive.com/rpy-list@lists.sourceforge.net/msg02779.html
 Try adding these two lines to rinterface/__init__.py
    # Load the R dll using the explicit path
    # First try the bin dir:
    Rlib = os.path.join(R_HOME, 'bin', 'R.dll')
    # Try bin/i386 subdirectory seen in R 2.12.0  ## ADDED ##
    if not os.path.exists(Rlib):                ## ADDED ##
      Rlib = os.path.join(R_HOME, 'bin', 'i386', 'R.dll')  ## ADDED ##
    # Then the lib dir:
    if not os.path.exists(Rlib):
      Rlib = os.path.join(R_HOME, 'lib', 'R.dll')
    # Otherwise fail out!
    if not os.path.exists(Rlib):
      raise RuntimeError("Unable to locate R.dll within %s" % R_HOME)

Hope that helps a bit,

Carson

--
Carson J. Q. Farmer
ISSP Doctoral Fellow
National Centre for Geocomputation
National University of Ireland, Maynooth,
http://www.carsonfarmer.com/



More information about the Qgis-user mailing list