I have installed anaconda in Docker Ubuntu 16.04LTS

    curl -O https://repo.continuum.io/archive/Anaconda3-4.2.0-Linux-x86_64.sh && \
    yes "yes" | bash Anaconda3-4.2.0-Linux-x86_64.sh && \
    sudo -s source ~/.bashrc

but when I do

RUN conda list

I get a /bin/sh: 1: conda: not found error.

According to anaconda install In order to activate the installation, you should source the ~/.bashrc file:, but it seems this did not work in this case.

  • can you please report the content of your .bashrc file just use cat ~/.bashrc – varnit Jul 23 '17 at 13:01
  • So that's it: export PATH="/root/yes/bin:$PATH". I do not see why it is in the yes/ folder. The which conda says /root/yes/bin/conda. I do not understand why it's in the yes command folder actually. If I login in the docker container conda works. In the Dockerfile it does not. – loretoparisi Jul 24 '17 at 8:55
  • 1
    I have changed then in this way /root/yes/bin/conda list to make it working. The problem seems to be the yes script then... – loretoparisi Jul 24 '17 at 9:20

Anaconda is still owing docker. So use:

RUN \bin\bash -c "conda list"
RUN \bin\bash -c "conda update conda"
RUN \bin\bash -c "conda install package"

.. etc. Enclose all your conda commands.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.