-
Notifications
You must be signed in to change notification settings - Fork 27
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 Python Path interaction #311
Comments
Dear @jadenecke, Yes, that makes sense! We use prepend-path in lmod to add new tools to the path. The idea is that every tool loaded through module load will overwrite previous binaries on the path if they are conflicting. Otherwise a module load wouldn't have an effect if for example fsl is already installed locally and one wants to try a newer version from Neurodesk. One solution that could work for you is to add the conda environment to the front of the path after you loaded the fsl module:
Would that work for you? |
yes, prepend-path makes sense. I think that solution would work for me, generally I think there are a few ways how to deal with it, however I can't think of a solution that does not require an adjustment in every script, i.e. a way to modify .bashrc or something similar. While writing, I found a possibly more convenient solution: Courtesy of chatGPT:
|
Dear @jadenecke - thank you for posting that solution! We will also keep thinking how we could do this better in the future. I currently think that the most elegant, reproducible and sustainable solution would be to also load the conda environment via lmod (and even offer different versions of conda environments and python versions ...). Then the active python environment would be fully controlled by the module load order: If one loads FSL first, and a conda module next, then the python will come from conda. If one loads conda first and then FSL, the python from FSL would be used (although it's questionable why one would do that). We exposed the python from FSL because some users wanted to run notebooks inside the FSL python environment. |
I am using conda venvs and neurocommand containers via lmod and everythings works as fine, with one unexpected interaction:
When I activate a conda environment and a FSL container the FSL module overrules the python binary from the conda environment (output of
which python3
is.../neurocommand/local/containers/fsl_6.0.7.4_20231005/python3
).Basically the module Paths comes first in the PATH variable (i.e.
.../neurocommand/local/containers/fsl_6.0.7.4_20231005
), while the updated conda path is somewhere after.I know that this is not a issue with neurocommand, however I dont know how to resolve the issue except loading and unloading the module a lot. I would be very happy if someone might have a solution or could point me in a specific direction.
The text was updated successfully, but these errors were encountered: