Skip to content
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

Add environment's bin to path #3

Open
frobnitzem opened this issue Jun 7, 2022 · 1 comment
Open

Add environment's bin to path #3

frobnitzem opened this issue Jun 7, 2022 · 1 comment

Comments

@frobnitzem
Copy link

frobnitzem commented Jun 7, 2022

Since conda can install binaries (like R) into the environment's bin, that bin directory should be added to PATH in the module.

In the current version, I see:

module show conda-env/analysis-py3.9.12
----------------------------------------------------------------------------
   $proj/modules/conda-env/analysis-py3.9.12.lua:
----------------------------------------------------------------------------
prepend_path("PATH","$proj/anaconda3/bin")
set_shell_function("pip","eval $proj/envs/analysis/bin/pip "$@"","eval $proj/envs/analysis/bin/pip $*")
set_shell_function("pip3","eval $proj/envs/analysis/bin/pip "$@"","eval $proj/envs/analysis/bin/pip $*")
pushenv("CONDA_PREFIX","$proj/envs/analysis")
pushenv("CONDA_DEFAULT_ENV","$proj/envs/analysis")
prepend_path("LD_LIBRARY_PATH","$proj/envs/analysis/lib")
prepend_path("PYTHONPATH","$proj/envs/analysis/lib/python3.9/site-packages")
pushenv("PYTHONNOUSERSITE","1")
@amaji
Copy link
Owner

amaji commented Jun 8, 2022

This is also one of those default choices. By default, conda-env-mod tries to use the Python from base anaconda. This is to ensure that users can use existing packages like numpy, matplotlib etc. without having to reinstall everything.

You can override the default using the switch --local-python when using conda-env-mod. In this case, the modulefile will add the environment's bin to PATH.

I've heard feedback from other users who also want the default to be --local-python, so we'll implement that with the next round of commits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants