Unable to change python path in reticulate (R)

瘦欲@ 提交于 2019-11-30 20:28:13

I observed that neither the technique "use_python('path')" nor the tactic of Sys.setenv(RETICULATE_PYTHON = 'path') in .RProfile worked for me (of course I am sure it must have worked for others.)

In any case the line at terminal,

which -a python python3

did produce two paths to choose from (one for python2 and one for python3 installed on my mac), so then I was able to create a ".Renviron" file in my home directory with this single line in it:

RETICULATE_PYTHON="/usr/local/bin/python3"

After I restarted RStudio, library(reticulate) activates the desired python3, and repl_python() opens a python3 interactive window, etc. etc.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!