微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

docker jupyter 要求,在构建期间安装但无法导入

如何解决docker jupyter 要求,在构建期间安装但无法导入

尝试从requirements.txt向jupyter docker image jupyter/pyspark-notebook添加包。在 docker build 期间,似乎安装了软件包。尝试在 jupyter 中的 notebook 中导入 azure blob 包并得到错误包找不到。从 jupyter 包中的 cmd 行运行 conda list 时,不在列表中?

Dockerfile

FROM jupyter/pyspark-notebook:latest
copY packages packages
RUN conda env update -f packages/environment.yml
# Install from requirements.txt file
copY --chown=${NB_UID}:${NB_GID} requirements.txt requirements.txt
RUN conda install --yes --file requirements.txt && \
    fix-permissions $CONDA_DIR && \
    fix-permissions /home/$NB_USER

requirements.txt

azure-storage-blob

来自构建日志

# Package Plan ##

  environment location: /opt/conda

  added / updated specs:
    - azure-storage-blob
    - numpy
    - pandas


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    azure-core-1.12.0          |     pyhd8ed1ab_0          64 KB  conda-forge
    azure-storage-blob-12.8.0  |     pyhd8ed1ab_0         187 KB  conda-forge
    isodate-0.6.0              |             py_1          25 KB  conda-forge
    msrest-0.6.21              |     pyh44b312d_0          50 KB  conda-forge
    pandas-1.2.4               |   py38h1abd341_0        12.0 MB  conda-forge
    requests-oauthlib-1.3.0    |     pyh9f0ad1d_0          21 KB  conda-forge
    ------------------------------------------------------------
                                           Total:        12.4 MB

The following NEW packages will be INSTALLED:

  azure-core         conda-forge/noarch::azure-core-1.12.0-pyhd8ed1ab_0
  azure-storage-blob conda-forge/noarch::azure-storage-blob-12.8.0-pyhd8ed1ab_0
  isodate            conda-forge/noarch::isodate-0.6.0-py_1
  msrest             conda-forge/noarch::msrest-0.6.21-pyh44b312d_0
  requests-oauthlib  conda-forge/noarch::requests-oauthlib-1.3.0-pyh9f0ad1d_0

The following packages will be UPDATED:

  pandas                               1.2.3-py38h51da96c_0 --> 1.2.4-py38h1abd341_0

Downloading and Extracting Packages

msrest-0.6.21        | 50 KB     | ########## | 100% 
pandas-1.2.4         | 12.0 MB   | ########## | 100% 
isodate-0.6.0        | 25 KB     | ########## | 100% 
azure-storage-blob-1 | 187 KB    | ########## | 100%
azure-core-1.12.0    | 64 KB     | ########## | 100% 
requests-oauthlib-1. | 21 KB     | ########## | 100% 
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。