-
Notifications
You must be signed in to change notification settings - Fork 112
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
Is there a way to deal with initializing conda correctly across multiple shells? #434
Comments
module-info shelltype helps to know the current shell type that module command has been initialized to. So you may write your modulefile the following way: switch -- [module-info shelltype] {
sh {
source-sh sh $CONDA_DIR/etc/profile.d/conda.sh
}
csh {
source-sh csh $CONDA_DIR/etc/profile.d/conda.csh
}
default {
error {Shell not supported}
}
} |
Thanks so much for the suggestion. I wanted to point out a strange behavior, when I implemented the module with:
I would invariably get:
the infuriating thing is that I could see that the conda alias was set correctly by the modulefile, namely:
which is exactly what sourcing the file:
sets it to (but sourcing the file outside of a modulefile does not give the In the end the only way I could find to make the modulefile work (and the issue of the
Any idea why this may be so? In any event I decided to post the trouble and its solution should other people experience the same issue. |
One more question, would you know how can I go about debugging this error which appears upon logging in from a zsh shell?
The error appears only at log-in and it prevents certain default modules from being loaded. Once the login is finished, however, the user can load the modules with no further error. We are running env mod version 4.7.0 and gcc 4.8.5 on a CentOS 7 cluster. Also do you know if there is a way to have a zsh not to give:
compaudit gives:
but on a close inspection I am not sure what is it that zsh complaints of being insecure as:
and:
Do you happen to have any idea? Thanks :) |
I suggest you add a |
It seems like |
Thanks a million for the suggestions!!! Indeed the zsh shell initialization gets stuck as it tries to load a modulefile for the intel compiler which is basically doing:
if I write the modulefile without sourcing the intel initialization script (but setting all the variables "by hand") the problem goes away. I think the issue is with some of the bash functions that the intel script sets up (I could send you more info in case you are interested). The interesting fact is that the error only occurs when /bin/zsh is run (we place a file in /etc/profile.d that will load a set of default modulefiles for all of our users), if a user with a zsh shell loads the intel module after logging in then there is no error. At this point I think I will just rewrite the intel modulefile without using the source-sh functionality. |
I suggest you adapt the code to use the current running shell rather
|
Issue found on csh shell with Conda should be fixed. Other fixes have been added to improve support of shell function on sh-kind shells. It would be great if you could test this new Modules version (current master git branch) and do not hesitate to open new issues if you still encounter errors. |
As this is perhaps a feature request I will chance posting it here and not on https://sourceforge.net/projects/modules/lists/modules-interest.
When creating a module file for anaconda invariably we need to request users to also source a conda shell script that varies according to the user shell, i.e.:
or:
since the file to be sourced are different enough using either sh-to-mod or source-sh would require that the modulefile first check on the user SHELL and branch out accordingly. Is this possible?
Thanks!
The text was updated successfully, but these errors were encountered: