
在我的計算機上成功安裝 R 和 Rstudio 後。我在 Rstudio 中安裝了“distill”包,如下所示:
> install.packages("distill")
。
幾分鐘後,它以致命錯誤結束:
/bin/bash: libpng-config: command not found
read.c:3:10: fatal error: png.h: No such file or directory
3 | #include
| ^~~~~~~
compilation terminated.
我在 Ubuntu 中搜尋瞭如何克服這個錯誤,但沒有找到簡單的方法。
答案1
解決此致命錯誤的最簡單方法是安裝“libpng”包,如下所示:
sudo apt-get install -y libpng-dev
。
然後,重新啟動 Rstudio 並嘗試再次安裝“distill”套件。就是這樣。