Script:
library(reticulate)
print('Trying Conda env')
use_condaenv(condaenv = 'condaenv',conda = '/opt/anaconda3')
print(paste0('Python is installed in: ', Sys.which('python')))
print(list.files(Sys.which('python')))
print('Installing pandas')
try(py_install('pandas'), envname = 'condaenv')
Output:
[1] "Loading reticulate library"
[1] "Trying Conda env"
[1] "Python is installed in: "
character(0)
[1] "Installing pandas"
Error : could not find a Python environment for /usr/bin/python3
Using list.files()
, I confirmed that /opt/anaconda3
definitely exists.
I set the path to /opt/anaconda3
with use_condaenv()
as above script, yet it is still searching in /usr/bin/python3
. Why is that?