Installing a R on WinPython

780 görüntüleme
İlk okunmamış mesaja atla

LucK

okunmadı,
3 Eki 2016 17:52:273.10.2016
alıcı WinPython
Recently I installed 'WinPython-64bit-3.5.2.2Qt5' 
I followed the Jupyter Notebook 'installing_R.ipynb' and it seemed to proceed as expected. 
But when I restarted Jupyter, the R kernel wasn't there.

In the past I followed the same procedure for 'WinPython-64bit-3.4.4.1' without any problems.
I noticed that in the 'settings' folder the subfolder 'kernel' was missing.
Based on my older installation I copied the folder and files and changed the "kernel.json" file manually.
Everything seems to work fine. 

Afterwards I saw that the cell "# make RKernel a movable installation with the rest of WinPython" previously showed the message
"patching C:\WinPython\WinPython-64bit-3.4.4.1-R\settings\kernels\ir\kernel.json from C:/WinPython/WinPython-64bit-3.4.4.1-R to {prefix}/.."

What may cause this problem?

LucK

okunmadı,
3 Eki 2016 18:28:023.10.2016
alıcı WinPython
It seems that the notebook 'installing_R' has changed.
I checked the output of the batch file 'R_launcher.bat' and noticed the following problem

* installing *source* package 'IRkernel' ...
** R
** inst
** tests
** preparing package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
  there is no package called 'stringr'
ERROR: lazy loading failed for package 'IRkernel'
* removing 'C:/WinPython/WinPython-Test/tools/R/library/IRkernel'
Error: Command failed (1)
Execution halted

I manually installed the package 'stringr' but that didn't resolve the problem because next I run into an error message regarding package 'rzmq'.

stonebig

okunmadı,
4 Eki 2016 14:27:544.10.2016
alıcı WinPython
Hi Lu, 

You are right, something changed, maybe "IRkernel" requirements ...

... you need to change this cell of the notebook (no more 'rzmq', add 'stringr' and 'crayon') ;

import os
import sys
import io
# let's create a R launcher  
r_launcher = r"""
@echo off
call %~dp0env.bat
rscript %*
"""
r_launcher_bat = os.environ["WINPYDIR"]+"\\..\\scripts\\R_launcher.bat"
# let's create a R init script
# in manual command line, you can use repos = c('http://irkernel.github.io/', getOption('repos'))
r_initialization = r"""
install.packages(c('repr', 'IRdisplay', 'stringr', 'crayon', 'pbdZMQ', 'devtools'), repos = c('http://cran.rstudio.com/', 'http://cran.rstudio.com/'))
devtools::install_github('IRkernel/IRkernel')
library('pbdZMQ')
library('repr')
library('IRkernel')
library('IRdisplay')
library('crayon')
library('stringr')
IRkernel::installspec()
"""
r_initialization_r = os.path.normpath(os.environ["WINPYDIR"]+"\\..\\scripts\\R_initialization.r")

for i in [(r_launcher,r_launcher_bat), (r_initialization, r_initialization_r)]:
    with io.open(i[1], 'w', encoding = sys.getdefaultencoding() ) as f:
        for line in i[0].splitlines():
            f.write('%s\n' %  line  )


stonebig

okunmadı,
4 Eki 2016 14:40:144.10.2016
alıcı WinPython
I notice also that "head('flights')" is uncorrect and should be "head(flights)" 

stonebig

okunmadı,
4 Eki 2016 14:46:394.10.2016
alıcı WinPython

LucK

okunmadı,
5 Eki 2016 08:20:535.10.2016
alıcı WinPython
Hi,
everything went well. thanks.
Luc
Tümünü yanıtla
Yazarı yanıtla
Yönlendir
0 yeni ileti