zee
July 6, 2020, 11:21pm
1
Hi,
This might be a really stupid question but I am trying to load Python into R and I am getting an error. I am using R markdown if that helps.
Code:
use_python("/Applications/Python 3.8", required = TRUE)
Error:
Error in use_python("/Applications/Python 3.8", required = TRUE) : failed to initialize requested version of Python
I am using a Mac. I'm not sure what I'm doing wrong. Any help would be appreciated!
zee
July 8, 2020, 7:38pm
3
Thanks for pointing this out to me. I tried that and the comment below that had to do with Macs specifically and neither worked.
zee
July 9, 2020, 12:06pm
4
I figured it out using the below code on a Mac:
Sys.setenv(RETICULATE_PYTHON = "/usr/local/bin/python3")
RETICULATE_PYTHON="/usr/local/bin/python3"
library(reticulate)
#Restart R, then run this block.
#Then run the py_config() to make sure the correct version of Python is being used.
system
Closed
July 16, 2020, 12:06pm
5
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.