reticulate weirdness

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/anaconda3with use_condaenv() as above script, yet it is still searching in /usr/bin/python3. Why is that?

HI,

From the documentation you might want to try adding this line after loading the library

options(reticulate.conda_binary = "/path/to/conda")

Hope this helps,
PJ

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.