I am making a shinydashboard app in R. I wanted to make an app that withdraws data from a database in AWS Athena every time it is deployed and display a DT table in my shiny app that gives you the option to see the information based on what date ranges you select in dateInputRange.
I needed an R package for this so I used RAthena
I also used the packages DBI
for the AWS CLI and paws
. I downloaded all what I needed for this like boto3 and so forth. I also made a aws profile that contained all important information like secret key, region, path to bucket etc. Anyways I established a connection to the database and locally I was able to withdraw information from the database. My app was running fine locally. However the app when uploaded to shiny app io and deployed a second time it would not show updated dates in table. I thought this might be due to how I set up the scripts in my app. It now contains three scripts only ui.R, server.R and a global.R
However after I did this I kept getting the error:
Error: Boto3 is not detected please install boto3 using either:
pip install boto3
in terminal orinstall_boto()
. Alternativelyreticulate::use_python
orreticulate::use_condaenv
will have to be used if boto3 is in another environment.
So I did as the error said to and I added:reticulate::use_virtualenv("RAthena")
to my global.R script where all data withdrawals and calculations are done. Here is the stack overflow answer. After I did this I got the error:
Error: Unable to find conda binary. Is Anaconda installed?
I decided to try then reticulate::use_condaenv("RAthena")
I then simply got the boto3 error again. The annoying part is I have checked in my terminal and Boto3 is successfully installed. I also have Anaconda installed I even updated Boto3.
I saw from the answer that it is possible to use noctau
to establish a database connection. I did this and everything worked fine locally. I was able to withdraw data from the database. Of course when I deployed this to shiny app io I got the error
Error in value[3L] : No region provided
I don't know why I have this error. In my aws profile my region for the database is specified. In R studio I see it in the connections tab in the right hand corner.
With the code dbGetInfo(con)
I see it there as well. I don't know what the solution is.