-
Notifications
You must be signed in to change notification settings - Fork 346
Description
I'm trying to use a conda environment with reticulate.
With use_python("~/.conda/envs/scanpy/bin/python", required=TRUE) I'm getting:
sh: symbol lookup error: sh: undefined symbol: rl_full_quoting_desired
Error in system2(command = python, args = shQuote(script), stdout = TRUE, :
error in running command '~/.conda/envs/scanpy/bin/python'This is due to the autosetup of LD_LIBRARY_PATH, adding ~/.conda/envs/scanpy/lib. This path contains libreadline.so without rl_full_quoting_desired, which gets preferred over my system libreadline.so that has this. My system shell gets invoked with the wrong libreadline, so I get this error.
The code path is the following:
use_pythonpython_configpython_config_impl:config <- tryCatch(system2(command = python, args = shQuote(script), stdout = TRUE, stderr = FALSE), error = function(e) { e$message <- paste(e$message, shQuote(python)) stop(e) })
Note that this fails with the shell invocation, before starting python. The minimal example to reproduce this issue on my system is running LD_LIBRARY_PATH=~/.conda/envs/scanpy/lib sh.
My conda environment's python executable runs fine without additional setup by setting RPATH/RUNPATH rather than LD_LIBRARY_PATH. If I'm not mistaken, so does every conda installation (and bash modules) in the meantime and setting LD_LIBRARY_PATH is explicitly discouraged.
Would it be possible to provide an environment variable (e.g. RETICULATE_NO_SETUP_LD_PATH) to disable the automatic discovery of the library path? if setting LD_LIBRARY_PATH is still required for other use cases