gcc_termux
gcc_termux copied to clipboard
Installing R kernel for Jupyter notebook
Is it possible to install R kernel in Termux? If yes, how can I do it? Thanks
Hi @yoshimoncho, It is possible to install IRkernel. I wish I had made notes about the process, so maybe if you could try to install it and let us know what errors you are running into. I'll list some of the steps that I do remember, many of which had errors installing dependencies that had to be resolved. The steps come from the IRkernel installation instructions (https://github.com/IRkernel/IRkernel), but have comments about changes I had to make.
- Install
devtools
in R:install.packages('devtools')
- I couldn't get the recommended step of using
devtools::install_github
to work, so I had to download IRkernel and installed locally. Download the zip of IRkernel from themaster
branch or the latest release, such asIRkernel-0.8.11.zip
. - Run
devtools::install_local('IRkernel-master.zip')
, if the zip file is in your R working directory. Otherwise, include the path or start R from the same directory as the zip file. If you run into problems with the zip file, you can unzip and rundevtools::install_local('IRkernel-master')
for the path where you extracted the archive. - Run
IRkernel::installspec()
I was able to install the tidyverse packages, which I could load and use from a R Jupyter Notebook. Let me know if you get stuck!
Hi there, I got stuck at point 3
> devtools::install_local('IRkernel-master')
Installing IRkernel
Installation failed: error in running command
DId you encounter the same error as well?
Thanks in advance!
Hi @clancia. I may have gotten that as well. If I did, I don't recall how I fixed it. Let me find another device and try to install it again to see if there are any missing steps from the original set of instructions.
Appreciated. Thank you very much.
Il ven 13 apr 2018, 18:02 Nam D. Nguyen [email protected] ha scritto:
Hi @clancia https://github.com/clancia. I may have gotten that as well. If I did, I don't recall how I fixed it. Let me find another device and try to install it again to see if there are any missing steps from the original set of instructions.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/its-pointless/gcc_termux/issues/25#issuecomment-381182477, or mute the thread https://github.com/notifications/unsubscribe-auth/AH8bJTy1gExniwQo57Z6yQCEQoTK5C_Hks5toMwQgaJpZM4Q8yLK .
--
Carlo Lancia, PhD
Mathematical Institute Leiden University DASPO Group sites.google.com/view/daspo
Before trying to install from GitHub using devtools, try setting R to use its internal unzip function:
options(unzip = "internal")
Also, if your R kernel dies because of missing X-11, check out this GitHub thread. The last recommendation to add option(bitmapType="cairo")
to the kernel.json
file fixed it for me.
Thank you very much. I will try.
Il giorno sab 26 mag 2018 alle ore 21:16 Rich [email protected] ha scritto:
Also, if your R kernel dies because of missing X-11, check out this GitHub thread https://github.com/IRkernel/IRkernel/issues/388. The last recommendation to add option(bitmapType="cairo") to the kernel.json file fixed it for me.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/its-pointless/gcc_termux/issues/25#issuecomment-392282559, or mute the thread https://github.com/notifications/unsubscribe-auth/AH8bJcMY6Tp8E2vsF_QTM9L8YDmvfZN7ks5t2an6gaJpZM4Q8yLK .
--
Carlo Lancia, PhD
Mathematical Institute Leiden University DASPO Group sites.google.com/view/daspo
yes im getting the same thing will have a look see if i cant get working amusingly i have got julia working in jupyter-notebook.
k got it working may have to install Cairo in R and that needs env variables set export CAIRO_LIBS="-lcairo" export CAIRO_CFLAGS="-I$PREFIX/include/cairo" then install Cairo in R install.packages('Cairo') then exit R and do this cat > $PREFIX/share/jupyter/kernels/opt-r-3.5.0/kernel.json <<EOF { "argv": ["$PREFIX/lib/R/bin/R", "--slave", "-e", "options(bitmapType='cairo') ; IRkernel::main()", "--args", "{connection_file}"], "display_name": "R 3.5.0", "language": "R" } EOF
this should be enough to get it to work
i guess i should do a bit of a tutorial about installing packages in julia as well at some point...
IS there any way we can check the logs ? Above fix did not work for me.
devtools::install_local('IRkernel-IRkernel-97c492b') Installing IRkernel Installation failed: error in running command
I installed Cairo and also made changes to kernel.json but no luck. it simply fails with error with no logs..
hi there
cannot load pbdZMQ
Error : .onLoad failed in loadNamespace() for 'pbdZMQ', details: call: fun(libname, pkgname) error: Could not load /data/data/com.termux/files/usr/lib/R/library/pbdZMQ/libs/libzmq.so : Error in dyn.load(dn.file, local = FALSE) : unable to load shared object '/data/data/com.termux/files/usr/lib/R/library/pbdZMQ/libs/libzmq.so': dlopen failed: cannot locate symbol "R_registerRoutines" referenced by "/data/data/com.termux/files/usr/lib/R/library/pbdZMQ/libs/libzmq.so"... ERROR: lazy loading failed for package ‘IRkernel’ removing ‘/data/data/com.termux/files/usr/lib/R/library/IRkernel
After installing successfully Cairo package (except for an Rconn "no") and IRkernel, I got this while using jupyter:
unable to load shared object '/data/data/com.termux/files/usr/lib/R/library/grDevices/libs///cairo.so': dlopen failed: cannot locate symbol "jpeg_std_error" referenced by "<...>libs/cairo.so"... In ok_device(filename,...) : failed to load cairo DLL.
Any ideas?
I just ran into the same issue with "libcairo":
unable to load shared object '/data/data/com.termux/files/usr/lib/R/library/grDevices/libs///cairo.so': dlopen failed: cannot locate symbol "jpeg_std_error" referenced by "<...>libs/cairo.so"... In ok_device(filename,...) : failed to load cairo DLL.
After 2 days of loading libraries, recompiling etc, I installed the juniper kernel: https://github.com/JuniperKernel/JuniperKernel
Just installed from CRAN as advised in the top of the READ ME.md :
install.packages("JuniperKernel") library(JuniperKernel) installJuniper(useJupyterDefault = TRUE) # install into default Jupyter kernel location
Works like a charm! (Haven't tried anything fancy yet though, only "1+1". But the kernel doesn't die !)
HI, I am unable install IRkernel because of this error when the install.packages function tries to load pbdZMQ:
.onLoad failed in loadNamespace() for 'pbdZMQ', details:
call: fun(libname, pkgname)
error: Could not load /data/data/com.termux/files/usr/lib/R/library/pbdZMQ/libs/libzmq.so : Error in dyn.load(dn.file, local = FALSE) :
unable to load shared object '/data/data/com.termux/files/usr/lib/R/library/pbdZMQ/libs/libzmq.so':
dlopen failed: cannot locate symbol "R_registerRoutines" referenced by "/data/data/com.termux/files/usr/lib/R/library/pbdZMQ/libs/libzmq.so"...