Skip to content
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

fix: install of package 'png' failed #68

Open
DataStrategyPro opened this issue Aug 21, 2020 · 2 comments · May be fixed by #76
Open

fix: install of package 'png' failed #68

DataStrategyPro opened this issue Aug 21, 2020 · 2 comments · May be fixed by #76

Comments

@DataStrategyPro
Copy link

DataStrategyPro commented Aug 21, 2020

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. docker pull rocker/rstudio:3.6.2
  2. docker run --rm -p 8787:8787 -e ROOT=TRUE -e PASSWORD=YourPassword rocker/rstudio:3.6.2
  3. http://localhost:8787/
  4. Login
  5. In Terminal run - git clone https://github.com/avisionh/dashboard-hkdistrictcouncillors.git
  6. Open project
  7. In R console run - renv::restore()

Expected behavior
Error installing package 'png':

  • installing source package ‘png’ ...
    ** package ‘png’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs
    gcc -I"/usr/local/lib/R/include" -DNDEBUG -I/usr/local/include libpng-config --cflags -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c read.c -o read.o
    /bin/bash: libpng-config: command not found
    read.c:3:10: fatal error: png.h: No such file or directory
    #include <png.h>

Desktop (please complete the following information):
Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
Codename: buster

Some notes on this issue
Tried this
https://community.rstudio.com/t/package-installation-failure/28938

and received this error
rstudio@7b7df37fe987:~$ sudo apt install libpng-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libpng-dev

Tried to find this package
https://packages.debian.org/search?searchon=names&keywords=libpng-dev

@avisionh
Copy link
Collaborator

avisionh commented Sep 8, 2020

Going through the docker tutorial you linked before here, it seems like you are running an existing Docker container, rocker. This Docker container might not have the required stuff installed, so possibly worth trying the following also:

apt-get update

I've tried the following in my macOS command terminal:

docker run -rm -p 8787:8787 rocker/verse

Then accessing the opened instance of the image, I've entered the following in the RStudio embedded terminal:

git clone https://github.com/Hong-Kong-Districts-Info/dashboard-hkdistrictcouncillors.git
cd dashboard-hkdistrictcouncillors

From there, I switched to the R console and entered:

renv::restore()

Very similar steps to yours and got pretty similar message:
image

Generally, it might be more standard for me to create a Docker container specifically for this repo and then for people to use this container. I'll put that on our backlog.

@avisionh
Copy link
Collaborator

avisionh commented Sep 8, 2020

Update

Fro discussing with @DataStrategyPro, work for me to start with base container, install packages and publish/share.

@avisionh avisionh linked a pull request Sep 20, 2020 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants