小编Jet*_* C.的帖子

激活 conda env 并在 Dockfile 中运行 pip install 要求

我可以dev1成功创建虚拟环境,但在 Docker 构建过程中无法激活它并切换到其中。

我想要的只是切换 venv 并将我的依赖项安装在requirements.txt.

我的代码:

WORKDIR /APP
ADD . /APP
ARG CONDA_VENV=dev1
RUN conda create -y --name ${CONDA_VENV} python=3.7
RUN conda activate ${CONDA_VENV}
RUN pip install -r requirements.txt
Run Code Online (Sandbox Code Playgroud)

错误:

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 …
Run Code Online (Sandbox Code Playgroud)

docker anaconda conda dockerfile docker-build

8
推荐指数
1
解决办法
2228
查看次数

标签 统计

anaconda ×1

conda ×1

docker ×1

docker-build ×1

dockerfile ×1