I'm using a Mac and have an Rstudio project ( my_project below) which I set up with renv and in my .Rprofile inside the project's directory I put these lines:
source("renv/activate.R")
renv::use_python()
Then in RStudio I did Session -> Restart R , which created R and Python virtual environments.
Then in RStudio 's terminal window I ran the command:
Error: Python shared library not found, Python bindings not loaded.
Use reticulate::install_miniconda() if you'd like to install a Miniconda Python environment.
I also tried sourcing the pythonvirtualenv in RStudio 's terminal window:
In addition, do you know how this copy of Python was built? If it wasn't build with a shared library, that would also explain the associated error here:
Error: Python shared library not found, Python bindings not loaded.
Note that Python needs to be configured with
./configure --enable-shared
during installation, so that a Python shared library is generated that reticulate can load.
Per the first question, I'm getting the same error as before:
> reticulate::py_config()
Error: Python shared library not found, Python bindings not loaded.
Use reticulate::install_miniconda() if you'd like to install a Miniconda Python environment.
Per the second question, I imagine it wasn't built with a shared library. What I did, which are the steps I described in my post above, is to be able to publish this code (which is a shiny app) on RStudio Connect, which works. Right now, I'm trying to do some debugging of this code on my Mac (where I'm publishing from) and I'm getting this RStudio/reticulate specific error.
Per the configuration with: ./configure --enable-shared
During installation of what should I use this configuration? (sorry if my question is banal, I'm not well versed in Python)
Error: Python shared library not found, Python bindings not loaded.
Use reticulate::install_miniconda() if you'd like to install a Miniconda Python environment.