I am trying to install the RPostgres library in R but I am using JupyterLab on Google Cloud Platform. I have found several suggestions on github.com/r-dbi/RPostgres, but none of them include information when working with Google Cloud Notebooks.
I continue to receive the error that RPostgres had "non-zero exit status" even after trying to install the package from the source code after placing it into the correct folder on JupyterLab:
install.packages("MyPath/RPostgres_1.3.3.tar.gz", repos=NULL, type='source')
I receive the same error message RPostgres had "non-zero exit status". Thanks.
To fix this, you first need to install "libpq-dev" as this is a prerequisite as per SO answer. Follow the steps below to apply this in a Google Cloud Notebook.
Open a terminal in your JupyterLab and execute sudo apt-get install libpq-dev
Open a R notebook, install Rpostgres using install.packages("RPostgres")
Run library()
and check if it was installed properly
Please take note that the machine I used for testing is created in AI Platform -> Notebooks -> R instance.