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

Docker installation: Your shell has not been properly configured to use 'conda activate'. #100

Closed
kyriakosschwarz opened this issue Oct 2, 2020 · 3 comments · Fixed by #131

Comments

@kyriakosschwarz
Copy link

When trying to create a Docker image through
docker build -t chemprop .
I get this error:
`Step 12/14 : RUN conda activate chemprop
---> Running in 1210dba161cc

CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run

$ conda init <SHELL_NAME>

Currently supported shells are:

  • bash
  • fish
  • tcsh
  • xonsh
  • zsh
  • powershell

See 'conda init --help' for more information and options.

IMPORTANT: You may need to close and restart your shell after running 'conda init'.
`

I tried modifying the Dockerfile:
SHELL ["/bin/bash", "-c"] RUN conda init bash RUN source "/opt/conda/bin/activate" RUN conda create -n chemprop python=3.7 RUN conda activate chemprop RUN conda install -c conda-forge rdkit RUN pip install -e .

But I still get the same issue.

@swansonk14
Copy link
Contributor

Hi @kyriakosschwarz, thanks for bringing up the issue! If that doesn't work, another thing you could try is changing conda activate chemprop to source activate chemprop. I've seen that this sometimes fixes the issue, especially on older versions of conda. Please let me know if this works or if you're still running into problems!

@kyriakosschwarz
Copy link
Author

Thank you @swansonk14 , it worked with source

@yichuanma95
Copy link

Hi @kyriakosschwarz, I ran into the same issue you had with the original Dockerfile. After following your modifications to it, I finally got chemprop to work with Docker. Thanks.

SHELL ["/bin/bash", "-c"]
RUN conda init bash
RUN source "/opt/conda/bin/activate"
RUN conda create -n chemprop python=3.7
RUN source activate chemprop
RUN conda install -c conda-forge rdkit
RUN pip install -e .

mliu49 added a commit that referenced this issue Jan 15, 2021
Update python and miniconda versions
Fix conda activate issue #100
Install into base environment to reduce image size
Set up non-root user for security
mliu49 added a commit that referenced this issue Jan 15, 2021
Update python and miniconda versions
Fix conda activate issue #100
Install into base environment to minimize extra packages
Use conda version of cuda toolkit instead of system
mliu49 added a commit that referenced this issue Jan 19, 2021
Update python and miniconda versions
Fix conda activate issue #100
Install into base environment to minimize extra packages
Use conda version of cuda toolkit instead of system
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

Successfully merging a pull request may close this issue.

3 participants