R Markdown is very nice way to write literate R code. Recently, reticulate
became available, which bridges R and Python in R Markdown documents.
If you use Pipenv for Python dependency management, here's how you get reticulate
to use the proper Python executable:
library('reticulate')
venv <- system("pipenv --venv", inter = TRUE)
use_virtualenv(venv, required = TRUE)
py_config()
The py_config()
command should print out the path to the Python executable in the virtualenv
created by Pipenv.
🌟 Was this page helpful? Please let me know with this quick, 3 question survey.