You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know there are several other issues with the same topic but what i found was not clear to me what versions of RStudio, Python, reticulate or other packages were used.
So I will describe my issue and I would kindly ask for a tutorial or reproduceable step by step guide to setup in RStudio an RPackage project that uses renv and successfully integrates python via reticulate.
Here is what i did:
1. Setup the RPackage project
open R
run: usethis::create_package('[[prj path]]')
a new project is created and opened in a new RSession
run: renv::init() renv::activate()
the R session restarts and the package has the structure updated
installed devtools install.packages("devtools")
2. Install reticulate
first tried usethis::use_package("reticulate")
But this installs the latest version of reticulate. After some reading for debugging different issues, have tried different version of reticulate, different versions of Rcpp etc.. So i ended up installing older versions of Rcpp and reticulate (exactly in this order as some articles suggested)
I know there are several other issues with the same topic but what i found was not clear to me what versions of RStudio, Python, reticulate or other packages were used.
So I will describe my issue and I would kindly ask for a tutorial or reproduceable step by step guide to setup in RStudio an RPackage project that uses renv and successfully integrates python via reticulate.
Here is what i did:
1. Setup the RPackage project
usethis::create_package('[[prj path]]')
renv::init()
renv::activate()
install.packages("devtools")
2. Install reticulate
usethis::use_package("reticulate")
But this installs the latest version of reticulate. After some reading for debugging different issues, have tried different version of reticulate, different versions of Rcpp etc.. So i ended up installing older versions of Rcpp and reticulate (exactly in this order as some articles suggested)
3. Set up Python integration
The crash
devtools::load_all()
reticulate::py_discover_config()
Outcome
python: …/myproj/renv/python/virtualenvs/renv-python-3.11/Scripts/python.exe
libpython: C:/Program Files/Python/Python311/python311.dll
pythonhome: …/myproj/renv/python/virtualenvs/renv-python-3.11
version: 3.11.9 (tags/v3.11.9:de54cf5, Apr 2 2024, 10:12:12) [MSC v.1938 64 bit (AMD64)]
Architecture: 64bit
numpy: …/myproj/renv/python/virtualenvs/renv-python-3.11/Lib/site-packages/numpy
numpy_version: 2.1.2
reticulate::py_version()
returns nothingreticulate::py_available()
returns falsereticulate::py_config()
crashes RStudioI am using the latest version of RStudio: 2024.09.0 Build 375, but in the process I have tried different versions of RStudio with the same result.
Thank you in advance for your support!
The text was updated successfully, but these errors were encountered: