Search code examples
rlinuxdirectorycondalibpng

Trouble installing libpng in R error: Cannot find such file


I currently have a conda environment created as "r_env" and is trying to install the "tensorflow" package into R on terminal. However, in R I keep having the same error, regardless if I am install "tensorflow" or "png" package directly from terminal after loading R.

enter image description here

I currently have the following packages installed in the conda env:

enter image description here

enter image description here

It appears to me that the installer is trying to look for the library files in ./conda/envs/r_env/lib/R/library whilst it is already installed in ./conda/envs/r_env. How may I rectify this issue? (Note: I do not have sudo privileges, but any solutions at this point is helpful!)


Solution

  • Use this code to install tensorFlow:

    library(keras)
      install_keras()
      devtools::install_github("rstudio/keras")
      install_tensorflow(package_url = "https://pypi.python.org/packages/b8/d6/af3d52dd52150ec4a6ceb7788bfeb2f62ecb6aa2d1172211c4db39b349a2/tensorflow-1.3.0rc0-cp27-cp27mu-manylinux1_x86_64.whl#md5=1cf77a2360ae2e38dd3578618eacc03b")
      library(tensorflow)
    

    After that try installing png:

    install.packages("png")
      library(png)
    

    Finally check png:

      capabilities()["png"]
    

    Output:

     png 
    TRUE