[Qgis-user] help manageR to find the path.......

Carson Farmer carson.farmer at gmail.com
Sun May 24 14:14:18 PDT 2009


Darren Norris wrote:
> Many thanks Carson,
> I added the line to in __init__.py and manageRDialog.py (below), if I 
> added to just the manageRDialog.py I got the same can't find R error.
> I have now just added to __init__.py  and get the python error (see 
> below for full): "ImportError: No module named win32api" ...
hmm, does your usb have it's own python as well, or are you using your 
system python? If you don't have win32api, you'll probably need to 
install the PyWin extensions: 
http://starship.python.net/crew/mhammond/win32/Downloads.html
>
> One of the reasons I work with the Renviron.site file is that I switch 
> between R on a USB and R on laptops / desktops. This flexibility is 
> very useful for me and also means I don't require administrator access 
> on computers where I don't have such permission.
> Would it be possible to have a file selector dialogue so a user can 
> simply "click" the path when manageR / Rpy can't find R? Or maybe a 
> dialogue that says this is the location of R that manageR will use, 
> OK? If not select the location.....
This might be an option, however, even if manageR did have this 
function, since you don't appear to have the win32 python extensions, it 
wouldn't matter in this case anyway... I'll see if I can add this in a 
future release.

I'm sorry I can't be of more help, but please let me know if the above 
helps at all? Also, see comments below:

> ****File Specifications******
> __init__.py:
>
> import ConfigParser
> import os.path
change the above line to 'import os' without the quotes
> os.environ['R_HOME'] = "C:\Users\Darren\R\R-2.9.0\bin"
> p = ConfigParser.ConfigParser()
> here = os.path.join(os.path.dirname(__file__),"config.ini")
> p.read(here)
>
> manageRDialog.py:
>
> import ConfigParser
> import os.path
same goes for the above line
> os.environ['R_HOME'] = "C:\Users\Darren\R\R-2.9.0\bin"
> parser = ConfigParser.ConfigParser()
> here = os.path.join( os.path.dirname( __file__ ),"config.ini" )
> parser.read( here ) 

Cheers,

Carson

-- 
Carson J. Q. Farmer
ISSP Doctoral Fellow
National Centre for Geocomputation (NCG),
National University of Ireland, Maynooth,
Email: Carson.Farmer at gmail.com
Web:   http://www.carsonfarmer.com/
       http://www.ftools.ca/




More information about the Qgis-user mailing list