I configured Jupyterhub with datascience-notebook (Selecting an Image — Docker Stacks documentation). When I try to install sf package for R from Terminal by inputing install.packages(“sf”), I got error:
>install.packages(“sf”)
................................
installing to /opt/conda/lib/R/library/00LOCK-s2/00new/s2/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation ath
* DONE (s2)
ERROR: dependency ‘units’ is not available for package ‘sf’
* removing ‘/opt/conda/lib/R/library/sf’
The downloaded source packages are in
‘/tmp/RtmpPcFudJ/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning messages:
1: In install.packages("sf") :
installation of package ‘units’ had non-zero exit status
2: In install.packages("sf") :
installation of package ‘sf’ had non-zero exit status
>
I try to install package units, but it requires package udunits…
It is unliklely to be related to jupyterhub, but rather the R installation in your image. It looks like installation of units failed, you could try by starting with installing units directly:
install.packages("units")
and see if you get a more informative error. I get:
configure: error:
--------------------------------------------------------------------------------
Configuration failed because libudunits2.so was not found. Try installing:
* deb: libudunits2-dev (Debian, Ubuntu, ...)
* rpm: udunits2-devel (Fedora, EPEL, ...)
* brew: udunits (OSX)
If udunits2 is already installed in a non-standard location, use:
--configure-args='--with-udunits2-lib=/usr/local/lib'
if the library was not found, and/or:
--configure-args='--with-udunits2-include=/usr/include/udunits2'
if the header was not found, replacing paths with appropriate values.
You can alternatively set UDUNITS2_INCLUDE and UDUNITS2_LIBS manually.
which suggests there is a missing dependency that you need to install first.
Thanks for the reply.
When I do install.packages(“units”), I get exactly what you have. It looks like I need to install libudunits-dev, but I don’t know how to install.
I try to do: install.packages(“libudunits”) and install.packages(“libudunits-dev”). Both don’t work. I check all installed packages by: installed.packages()[,], I don’t find out packages of libudunits or libudunuts-dev.
My Jupyterhub version is Ubuntu 22.04. Please see the output:
Thanks. You are right. I have no root privilege under Jupyterhub.
jovyan@jupyter-xiaowang:~$ sudo ls
sudo: The "no new privileges" flag is set, which prevents sudo from running as root.
sudo: If sudo is running in a container, you may need to adjust the container configuration to disable the flag.