I have an app that I want to deploy on shinyapps.io. I think it is important to note that in the app data is extracted from a database in athena. I used the package Rathena to connect to the database and everything used to run fine locally from my computer. However I tried to deploy it on shinyapps.io and I get a message that an error has occurred. I see this simply in the window that pops up after I deployed it. I went and looked at the log section from shinyapps.io and I see the message that says:
warning: using reticulate but python was not specified; will use python at /usr/bin/python3 Did you forget to set the RETICULATE_PYTHON environment variable in your .Rprofile before publishing?
I have never used an .Rprofile and I don't know what it means by RETICULATE_PYTHON. Anyways they say on stack overflow google is your best friend. I found this tutorial on Github called Tutorial: using Shiny + reticulate to create apps with R and Python 3. I did the initial steps like it says to and then it says at the end:
Confirm that the .Rprofile file is included in your project's directory and was deployed along with server.R and ui.R to shinyapps.io. This file sets the RETICULATE_PYTHON environment variable, which tells reticulate where to locate the Python virtual environment on the shinyapps.io servers.
I looked up what .Rprofile is and I think it's just a script for code but It doesn't tell me what code I should put there. I think I need to mention that package Rathena uses Python code to connect to the database.
I also read somewhere that I should place this line RETICULATE_PYTHON = /usr/local/bin/python3 in my .Renviron file. I did this and now when I try to run the app locally on my computer I get the error message:
Error: Boto3 is not detected please install boto3 using either:
pip install boto3 numpy
in terminal orinstall_boto()
. If this doesn't work please set the python you are using withreticulate::use_python()
orreticulate::use_condaenv()
This doesn't make sense because I already have installed boto3 and even in the terminal it says
Requirement already satisfied: boto3 in ./Library/r-miniconda/envs/r-reticulate/lib/python3.6/site-packages (1.14.28)
I feel like I am going in circles here.