rocker-org / rocker-versioned

Run current & prior versions of R using docker
https://hub.docker.com/r/rocker/r-ver
GNU General Public License v2.0
297 stars 169 forks source link

Can not install Seurat with install.packages("Seurat") #155

Closed JingqunMa closed 5 years ago

JingqunMa commented 5 years ago

ERROR: dependency 'png'™ is not available for package 'Seurat'™

eddelbuettel commented 5 years ago

You need to install png first, which may require a libpng-dev package. Please show the errors you get when you try to install png -- in short, no Seurat without png as per the package page too

JingqunMa commented 5 years ago

Thank you @eddelbuettel for the reply. Here is the error when I tried to install png> install.packages("png") Installing package into ‘/usr/local/lib/R/site-library’ (as ‘lib’ is unspecified) trying URL 'https://mran.microsoft.com/snapshot/2019-06-16/src/contrib/png_0.1-7.tar.gz' Content type 'application/octet-stream' length 24990 bytes (24 KB)

downloaded 24 KB

The downloaded source packages are in ‘/tmp/Rtmp7kmOsC/downloaded_packages’ Warning message: In install.packages("png") : installation of package ‘png’ had non-zero exit status

JingqunMa commented 5 years ago

libpng-dev also can't be installed. Here is the error: install.packages("libpng-dev") Installing package into ‘/usr/local/lib/R/site-library’ (as ‘lib’ is unspecified) Warning message: package ‘libpng-dev’ is not available (for R version 3.6.0)

eddelbuettel commented 5 years ago

read.c:3:17: fatal error: png.h: No such file or directory #include

You deal with that at the shell command prompt not the R prompt as it is a system library.

eddelbuettel commented 5 years ago
edd@rob:~$ dpkg -S /usr/include/png.h
libpng-dev:amd64: /usr/include/png.h
edd@rob:~$ 

So you need sudo apt-get install libpng-dev to move along.

JingqunMa commented 5 years ago

I am running the docker on a cloud machine which I don't have sudo access.

eddelbuettel commented 5 years ago

You only need sudo inside the container.

If the container does not have the (system-level) png library and headers, then you cannot install the CRAN package png meaning you cannot install CRAN package Seurat. No shortcuts.

You could look into modifying the Docker container and runnning a modified one ...

But in short nothing here is a bug in Rocker so I will close this.

g-torr commented 3 years ago

a workaround for not using sudo is change the PATH and remove temporary the paths pointing to anaconda for the installation, see https://stackoverflow.com/a/59556852 In practise, type in your terminal echo $PATH copy the output on a text editor and remove lines like: /opt/apps/devtools/anaconda/2019.3/python/3.7.3/bin export PATH = 'paste the new path here '

eddelbuettel commented 3 years ago

I suggest we delete this comment. Mixing Rocker with anaconda is a not generally a good idea.