rgoogle-cloud-platforminstallationrpostgres

Installing RPostgres Library in Jupyter Notebook on Google Cloud Platform


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.


Solution

  • 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.

    Please take note that the machine I used for testing is created in AI Platform -> Notebooks -> R instance.