是否可以在Anaconda中安装最新版本的Tensorflow(截至8/2021的2.4.1)和R (4.1.1) ?
我正在尝试使用具有这两者的Jupyter Spark基础映像创建Docker映像。完成此操作的最小dockerfile是
FROM jupyter/pyspark-notebook:notebook-6.4.2
USER root
ENV R_LIBS_USER $SPARK_HOME/R/lib
RUN fix-permissions $R_LIBS_USER
USER $NB_UID
RUN mamba install --quiet --yes
'tensorflow=2.4.1'
'r-base=4.1.1'
使用docker build . -f "minimal.dockerfile" -t minimal:latest
运行此命令会导致错误:
=> [internal] load build definition from minimal.dockerfile 0.1s
=> => transferring dockerfile: 426B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/jupyter/pyspark-notebook:notebook-6.4. 3.0s
=> [auth] jupyter/pyspark-notebook:pull token for registry-1.docker.io 0.0s
=> [1/3] FROM docker.io/jupyter/pyspark-notebook:notebook-6.4.2@sha256:a9a92d02f 0.0s
=> CACHED [2/3] RUN fix-permissions /usr/local/spark/R/lib 0.0s
=> ERROR [3/3] RUN mamba install --quiet --yes 'tensorflow=2.4.1' 'r-ba 33.8s
------
> [3/3] RUN mamba install --quiet --yes 'tensorflow=2.4.1' 'r-base=4.1.1':
#7 33.19 Encountered problems while solving:
#7 33.19 - package arrow-cpp-5.0.0-py39he92c077_3_cpu requires libprotobuf >=3.16.0,<3.17.0a0, but none of the providers can be installed
#7 33.19
------
executor failed running [/bin/bash -o pipefail -c mamba install --quiet --yes 'tensorflow=2.4.1' 'r-base=4.1.1']: exit code: 1
如果我只运行mamba install tensorflow=2.4.1
,我可以看到它降级了arrow-cpp和libprotobuf等。是否有办法克服这种行为?
我尝试过的其他事情:
- 如果我运行
mamba install tensorflow
之后是mamba install r-base
,我得到与上面相同的错误 - 如果我运行
mamba install r-base
之后是mamba install tensorflow
,我最终得到R 3.6,而不是4.1.1
不要尝试在一个环境中安装所有内容。创建一个Python环境和一个R环境,并确保它们都有各自的内核包(ipykernel
,r-irkernel
),以便它们可以在Jupyter中使用。