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

Conda env configuration problem in sysbio-training/masters-2020/epigenetics/Dockerfile #1

Open
iromeo opened this issue Nov 20, 2020 · 1 comment
Assignees

Comments

@iromeo
Copy link
Collaborator

iromeo commented Nov 20, 2020

Due 'PATH="/opt/conda/envs/bio/bin:${PATH}"' >> ~/.profile & in the line

# Fix: R shell uses env variables from ~/profile
RUN echo 'PATH="/opt/conda/bin:${PATH}"' >> ~/.profile && \
	echo 'PATH="/opt/conda/envs/bio/bin:${PATH}"' >> ~/.profile && \
	echo 'LD_LIBRARY_PATH="/opt/conda/lib:${LD_LIBRARY_PATH}"' >> ~/.profile && \
	echo "export LC_ALL=C.UTF-8" >> ~/.profile && \
    echo "export LANG=C.UTF-8" >> ~/.profile

users get bio conda env bin folder even if the other environment is activated, this leads broken environments except bio:

(base) student@ad992674a9d9:~$ echo $PATH
/opt/conda/envs/bio/bin:/opt/conda/bin:/opt/conda/bin:/opt/conda/condabin:/opt/conda/envs/bio/bin:/opt/conda/bin:/opt/conda/envs/bio/bin:/opt/conda/bin:/opt/conda/envs/bio/bin:/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/rstudio-server/bin/postback:/usr/lib/rstudio-server/bin/postback:/usr/lib/rstudio-server/bin/postback:/opt/conda/envs/bio/bin
(base) student@ad992674a9d9:~$ conda activate meth
(meth) student@ad992674a9d9:~$ echo $PATH
/opt/conda/envs/bio/bin:/home/student/.conda/envs/meth/bin:/opt/conda/bin:/opt/conda/condabin:/opt/conda/envs/bio/bin:/opt/conda/bin:/opt/conda/envs/bio/bin:/opt/conda/bin:/opt/conda/envs/bio/bin:/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/rstudio-server/bin/postback:/usr/lib/rstudio-server/bin/postback:/usr/lib/rstudio-server/bin/postback:/opt/conda/envs/bio/bin
(meth) student@ad992674a9d9:~$ which multiqc
/opt/conda/envs/bio/bin/multiqc
(meth) student@ad992674a9d9:~$ cat /mnt/meth/conda_envs/meth.yaml | grep 'multiqc'
  - multiqc=1.9
(meth) student@ad992674a9d9:~$ multiqc --version^C
(meth) student@ad992674a9d9:~$ cat /mnt/meth/conda_envs/meth.yaml | grep 'python'
  - python=3.7
  - ipython=7.19.0
(meth) student@ad992674a9d9:~$ which python
/opt/conda/envs/bio/bin/python
(meth) student@ad992674a9d9:~$ python --version
Python 2.7.17 :: Anaconda, Inc.
(meth) student@ad992674a9d9:~$ multiqc --version
/opt/conda/envs/bio/lib/python2.7/site-packages/multiqc-1.0.dev0-py2.7.egg/multiqc/utils/config.py:44: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  configs = yaml.load(f)
/opt/conda/envs/bio/lib/python2.7/site-packages/multiqc-1.0.dev0-py2.7.egg/multiqc/utils/config.py:50: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  sp = yaml.load(f)
multiqc, version 1.0.dev0
@iromeo
Copy link
Collaborator Author

iromeo commented Nov 20, 2020

Line PATH="/opt/conda/bin:${PATH}"' >> ~/.profile also isn't valid, instead should be

/home/student/.bashrc:

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/opt/conda/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/opt/conda/etc/profile.d/conda.sh" ]; then
        . "/opt/conda/etc/profile.d/conda.sh"
    else
        export PATH="/opt/conda/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<

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