-
Notifications
You must be signed in to change notification settings - Fork 332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
conda fails to run activate scripts, resulting in incorrect paths #1707
Comments
Encountering the same issue, it seems to me that this issue is also related to multiple issues that were reported in the past, like:
According to these sources, you have accurately identified the issue, being that rstudio is affecting Until this is a resolved, a suggest workaround would be to create a virtual env instead of a conda environment, i.e., |
Thanks @adisarid . For some more context you might find this helpful: https://docs.conda.io/projects/conda-build/en/latest/resources/activate-scripts.html . As you have noted, activation scripts are an optional feature used by some conda packages. Running the activation scripts the way conda expects should probably resolve this and may avoid unintended consequences of some of the suggestions listed in these threads (like LD_LIBPRARY_PATH, which sound like they could impact the behavior of non-conda packages that should be linking against system libraries instead of the conda ones). e.g. for the above, I think this happens because https://github.com/conda-forge/gdal-feedstock/blob/main/recipe/scripts/activate.sh is not run. This would normally happen by activating conda, which I think means sourcing https://github.com/conda-forge/gdal-feedstock/blob/main/recipe/build.sh#L102. I think this is what reticulate should be doing when the user sets a conda env, instead of just altering PATH, but I haven't tracked through all the details here. At very least it might be worth mentioning in the docs conda is going to be only partially supported. I'm well aware of virtual envs as well, but in many contexts that is not going to be a viable alternative. |
The following python script fails to run in a conda-based environment:
Throwing the error:
Note carefully the import path listed,
ImportError: /usr/lib/x86_64-linux-gnu/libssl.so.3:
. This is not the correct path for a conda environment, conda does not link the system library, and the correct path should be within the parent Conda environment, not the system.This error can be reproduced in pure python from the bash terminal if we call a conda environment from PATH without doing the
conda activate
step (or in a base env,conda init
andsource ~/.bashrc
). As I understand it, packages like this one (or those it depends on) have activation hooks that must be set to link libraries appropriately, and it appears that reticulate isn't doing this when working with conda?The text was updated successfully, but these errors were encountered: