-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add R language support #9
Comments
|
After R kernel works, I want to add an example of using Polars with R language: https://github.com/pola-rs/r-polars I'll just do the exact same notebook, in typescript, and R language (perhaps later in python the others interested in python could do it |
… jupyter kernel silently
jbl@pokus2:~/poc-data-visualization$ docker-compose exec -T jupyter_deno bash -c 'source ~/.bashrc && conda --version' conda 24.1.2
jbl@pokus2:~/poc-data-visualization$ docker-compose exec -T jupyter_deno bash -c 'source ~/.bashrc && Rscript --version'
R scripting front-end version 3.5.0 (2018-04-23)
jbl@pokus2:~/poc-data-visualization$ docker-compose exec -T jupyter_deno bash -c 'source ~/.bashrc && R --version'
R version 3.5.0 (2018-04-23) -- "Joy in Playing"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
http://www.gnu.org/licenses/.
Oh how to install ikernel but with the github repo instructions, to register the kernel to jupyter : jbl@pokus2:~/poc-data-visualization$ docker-compose exec -T jupyter_deno bash
pwd
/usr/dataviz/notebooks/decoderleco
bash
ls -alh
total 32K
drwxr-xr-x 7 1000 1000 4.0K Mar 9 16:54 .
drwxr-xr-x 3 root root 4.0K Mar 5 21:20 ..
drwx------ 4 root root 4.0K Mar 8 22:27 .Trash-0
drwxr-xr-x 2 root root 4.0K Mar 8 22:27 .ipynb_checkpoints
drwxr-xr-x 3 1000 1000 4.0K Mar 5 21:15 data
drwxr-xr-x 3 1000 1000 4.0K Mar 8 11:50 first-examples
-rw-r--r-- 1 root root 70 Mar 9 16:55 install.ikernel.r
drwxr-xr-x 3 1000 1000 4.0K Mar 9 15:56 jb
cat install.ikernel.r
install.packages(IRkernel)
IRkernel --version
IRkernel::installspec()
echo "install.packages('IRkernel')" | tee -a ./install.ikernel.r
install.packages('IRkernel')
cat install.ikernel.r
install.packages(IRkernel)
IRkernel --version
IRkernel::installspec()
install.packages('IRkernel')
echo "install.packages('IRkernel')" | tee ./install.ikernel.r
install.packages('IRkernel')
cat install.ikernel.r
install.packages('IRkernel')
echo "IRkernel::installspec()" | tee -a ./install.ikernel.r
IRkernel::installspec()
cat install.ikernel.r
install.packages('IRkernel')
IRkernel::installspec()
Rscript ./install.ikernel.r
bash: line 12: Rscript: command not found
Rscript --version
bash: line 13: Rscript: command not found
exit
exit
jbl@pokus2:~/poc-data-visualization$ docker-compose exec -T jupyter_deno bash -c 'source ~/.bashrc && Rscript ./install.ikernel.r'
Error in contrib.url(repos, type) :
trying to use CRAN without setting a mirror
Calls: install.packages -> grep -> contrib.url
Execution halted
jbl@pokus2:~/poc-data-visualization$ docker-compose exec -T jupyter_deno bash
cat ./install.ikernel.r
install.packages('IRkernel')
IRkernel::installspec()
echo 'options(repos = c(CRAN = "https://cloud.r-project.org"))' > ~/.Rprofile
exit
jbl@pokus2:~/poc-data-visualization$ docker-compose exec -T jupyter_deno bash -c 'source ~/.bashrc && Rscript ./install.ikernel.r'
trying URL 'https://cloud.r-project.org/src/contrib/IRkernel_1.3.2.tar.gz'
Content type 'application/x-gzip' length 45172 bytes (44 KB)
==================================================
downloaded 44 KB
* installing *source* package ‘IRkernel’ ...
** package ‘IRkernel’ successfully unpacked and MD5 sums checked
** R
** inst
** byte-compile and prepare package for lazy loading
code for methods in class “CommManager” was not checked for suspicious field assignments (recommended package ‘codetools’ not available?)
code for methods in class “Comm” was not checked for suspicious field assignments (recommended package ‘codetools’ not available?)
code for methods in class “Executor” was not checked for suspicious field assignments (recommended package ‘codetools’ not available?)
code for methods in class “Kernel” was not checked for suspicious field assignments (recommended package ‘codetools’ not available?)
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (IRkernel)
The downloaded source packages are in
‘/tmp/Rtmpd8UdHc/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
jbl@pokus2:~/poc-data-visualization$
yeahhhhhhhhh :D : |
ok we have the feature of R language support, plus some good sweeties, only left to do :
|
Big issue with the R KernelHere is the issue I got : jupyter_deno_1 | Error in dev.control(displaylist = "enable") :
jupyter_deno_1 | dev.control() called without an open graphics device
jupyter_deno_1 | Calls: <Anonymous> ... tryCatch -> tryCatchList -> evaluate -> dev.control
jupyter_deno_1 | In addition: Warning messages:
jupyter_deno_1 | 1: In ok_device(filename, ...) :
jupyter_deno_1 | unable to load shared object '/root/anaconda3/lib/R/library/grDevices/libs//cairo.so':
jupyter_deno_1 | libXrender.so.1: cannot open shared object file: No such file or directory
jupyter_deno_1 | 2: In ok_device(filename, ...) : failed to load cairo DLL
jupyter_deno_1 | Execution halted
Sources of infos I found while googling that:
First try at fixing issueOk, i read a bit the issues comment I and soon found that lots of libraries were installed, in the official jupyter nootebooks docker container image for # R pre-requisites
RUN apt-get update --yes && \
apt-get install --yes --no-install-recommends \
fonts-dejavu \
unixodbc \
unixodbc-dev \
r-cran-rodbc \
gfortran \
gcc && \
apt-get clean && rm -rf /var/lib/apt/lists/*
RUN mamba install --yes \
'r-base' \
'r-caret' \
'r-crayon' \
'r-devtools' \
'r-e1071' \
'r-forecast' \
'r-hexbin' \
'r-htmltools' \
'r-htmlwidgets' \
'r-irkernel' \
'r-nycflights13' \
'r-randomforest' \
'r-rcurl' \
'r-rmarkdown' \
'r-rodbc' \
'r-rsqlite' \
'r-shiny' \
'r-tidymodels' \
'r-tidyverse' \
'unixodbc' && \ I did not install apt-get update --yes && \
apt-get install --yes --no-install-recommends \
fonts-dejavu \
unixodbc \
unixodbc-dev \
r-cran-rodbc \
gfortran \
gcc && \
apt-get clean && rm -rf /var/lib/apt/lists/*
conda install --yes \
'r-base' \
'r-caret' \
'r-crayon' \
'r-devtools' \
'r-e1071' \
'r-forecast' \
'r-hexbin' \
'r-htmltools' \
'r-htmlwidgets' \
'r-irkernel' \
'r-nycflights13' \
'r-randomforest' \
'r-rcurl' \
'r-rmarkdown' \
'r-rodbc' \
'r-rsqlite' \
'r-shiny' \
'r-tidymodels' \
'r-tidyverse' \
'unixodbc' && \
conda clean --all -f -y && \
conda update --all -y
# mamba clean --all -f -y && \
# fix-permissions "${CONDA_DIR}" && \
# fix-permissions "/home/${NB_USER} Yet, before trying the above huge changes, even if they make sense, I will do something that makes just as much sense, and brigns a much smaller change:
Test 1: installing libxrender with
|
…v libfribidi-dev] linux packages decoder-leco/decoderleco_deces_europe_reloaded#1 (comment)
…[r-notebook] docker image
…#1 (comment)): set r-base version to 4.3.1 its the latest available in the 'r' conda channel
We'lll say its done with https://github.com/decoder-leco/poc-data-visualization/releases/tag/0.0.1 |
The text was updated successfully, but these errors were encountered: