PackagesNotFoundError:当前渠道无法提供以下软件包:

问题描述 投票:0回答:1

我正在尝试构建基于 anaconda 的 python 应用程序的 docker 映像: 这是 dockerfile :

FROM continuumio/miniconda3
# setting the working directory 
WORKDIR /usr/src/app
COPY . /usr/src/app
RUN conda env create --file environment.yml
SHELL ["conda", "run", "-n", "app", "/bin/bash", "-c"]
EXPOSE 8050
ENTRYPOINT ["streamlit","run","main.py","--server.port=8501", "--server.address=0.0.0.0"]

我执行了

conda env export > environment.yml
来生成此文件
environment.yml

environment.yml
内容:

name: app
channels:
  - conda-forge
  - defaults
dependencies:
  - altair=5.0.1=py312haa95532_0
  - arrow-cpp=16.1.0=h7cd61ee_0
  - attrs=24.2.0=py312haa95532_0
  - aws-c-auth=0.6.19=h2bbff1b_0
  - aws-c-cal=0.5.20=h2bbff1b_0
  - aws-c-common=0.8.5=h2bbff1b_0
  - aws-c-compression=0.2.16=h2bbff1b_0
  - aws-c-event-stream=0.2.15=hd77b12b_0
  - aws-c-http=0.6.25=h2bbff1b_0
  - aws-c-io=0.13.10=h2bbff1b_0
  - aws-c-mqtt=0.7.13=h2bbff1b_0
  - aws-c-s3=0.1.51=h2bbff1b_0
  - aws-c-sdkutils=0.1.6=h2bbff1b_0
  - aws-checksums=0.1.13=h2bbff1b_0
  - aws-crt-cpp=0.18.16=hd77b12b_0
  - aws-sdk-cpp=1.10.55=hd77b12b_0
  - blas=1.0=mkl
  - blinker=1.6.2=py312haa95532_0
  - boost-cpp=1.82.0=h59b6b97_2
  - bottleneck=1.3.7=py312he558020_0
  - brotli=1.0.9=h2bbff1b_8
  - brotli-bin=1.0.9=h2bbff1b_8
  - brotli-python=1.0.9=py312hd77b12b_8
  - bzip2=1.0.8=h2bbff1b_6
  - c-ares=1.19.1=h2bbff1b_0
  - ca-certificates=2024.11.26=haa95532_0
  - cachetools=5.3.3=py312haa95532_0
  - certifi=2024.8.30=py312haa95532_0
  - charset-normalizer=3.3.2=pyhd3eb1b0_0
  - click=8.1.7=py312haa95532_0
  - colorama=0.4.6=py312haa95532_0
  - contourpy=1.3.1=py312h214f63a_0
  - cycler=0.11.0=pyhd3eb1b0_0
  - et_xmlfile=1.1.0=py312haa95532_1
  - expat=2.6.3=h5da7b33_0
  - fonttools=4.51.0=py312h2bbff1b_0
  - freetype=2.12.1=ha860e81_0
  - gflags=2.2.2=hd77b12b_1
  - gitdb=4.0.7=pyhd3eb1b0_0
  - gitpython=3.1.43=py312haa95532_0
  - glog=0.5.0=hd77b12b_1
  - greenlet=3.0.1=py312hd77b12b_0
  - htbuilder=0.6.2=py312haa95532_0
  - icc_rt=2022.1.0=h6049295_2
  - icu=73.1=h6c2663c_0
  - idna=3.7=py312haa95532_0
  - importlib-metadata=7.2.1=pyha770c72_0
  - intel-openmp=2023.1.0=h59b6b97_46320
  - jinja2=3.1.4=py312haa95532_0
  - jpeg=9e=h827c3e9_3
  - jsonschema=4.23.0=py312haa95532_0
  - jsonschema-specifications=2023.7.1=py312haa95532_0
  - kiwisolver=1.4.4=py312hd77b12b_0
  - krb5=1.20.1=h5b6d351_0
  - lcms2=2.12=h83e58a3_0
  - lerc=3.0=hd77b12b_0
  - libabseil=20240116.2=cxx17_h5da7b33_0
  - libboost=1.82.0=h3399ecb_2
  - libbrotlicommon=1.0.9=h2bbff1b_8
  - libbrotlidec=1.0.9=h2bbff1b_8
  - libbrotlienc=1.0.9=h2bbff1b_8
  - libclang=14.0.6=default_hb5a9fac_1
  - libclang13=14.0.6=default_h8e68704_1
  - libcurl=8.9.1=h0416ee5_0
  - libdeflate=1.17=h2bbff1b_1
  - libevent=2.1.12=h56d1f94_1
  - libffi=3.4.4=hd77b12b_1
  - libgrpc=1.62.2=hf25190f_0
  - libpng=1.6.39=h8cc25b3_0
  - libpq=12.17=h906ac69_0
  - libprotobuf=4.25.3=hf2fb9eb_0
  - libssh2=1.11.0=h291bd65_0
  - libthrift=0.15.0=h4364b78_2
  - libtiff=4.5.1=hd77b12b_0
  - libwebp-base=1.3.2=h3d04722_1
  - lz4-c=1.9.4=h2bbff1b_1
  - markdown-it-py=2.2.0=py312haa95532_1
  - markupsafe=2.1.3=py312h2bbff1b_0
  - matplotlib=3.9.2=py312haa95532_1
  - matplotlib-base=3.9.2=py312he19b0ae_1
  - mdurl=0.1.0=py312haa95532_0
  - mkl=2023.1.0=h6b88ed4_46358
  - mkl-service=2.4.0=py312h2bbff1b_1
  - mkl_fft=1.3.10=py312h827c3e9_0
  - mkl_random=1.2.7=py312h0158946_0
  - more-itertools=10.3.0=py312haa95532_0
  - numexpr=2.8.7=py312h96b7d27_0
  - numpy=1.26.4=py312hfd52020_0
  - numpy-base=1.26.4=py312h4dde369_0
  - openjpeg=2.5.2=hae555c5_0
  - openpyxl=3.1.5=py312h827c3e9_0
  - openssl=3.4.0=h2466b09_0
  - orc=2.0.1=hd8d391b_0
  - packaging=24.1=py312haa95532_0
  - pandas=2.2.2=py312h0158946_0
  - pillow=10.4.0=py312h827c3e9_0
  - pip=24.2=py312haa95532_0
  - plotly=5.24.1=py312hfc267ef_0
  - ply=3.11=py312haa95532_1
  - protobuf=4.25.3=py312h958608f_0
  - psycopg2=2.9.9=py312h2bbff1b_0
  - pyarrow=16.1.0=py312h0158946_0
  - pydeck=0.8.0=py312haa95532_2
  - pygments=2.15.1=py312haa95532_1
  - pyparsing=3.2.0=py312haa95532_0
  - pyqt=5.15.10=py312hd77b12b_0
  - pyqt5-sip=12.13.0=py312h2bbff1b_0
  - pysocks=1.7.1=py312haa95532_0
  - python=3.12.7=h14ffc60_0
  - python-dateutil=2.9.0post0=py312haa95532_2
  - python-dotenv=0.21.0=py312haa95532_0
  - python-tzdata=2023.3=pyhd3eb1b0_0
  - pytz=2024.1=py312haa95532_0
  - pyyaml=6.0.2=py312h827c3e9_0
  - qt-main=5.15.2=h19c9488_10
  - re2=2022.04.01=hd77b12b_0
  - referencing=0.30.2=py312haa95532_0
  - requests=2.32.3=py312haa95532_0
  - rich=13.7.1=py312haa95532_0
  - rpds-py=0.10.6=py312h062c2fa_0
  - scipy=1.14.1=py312h9d85e7c_0
  - setuptools=75.1.0=py312haa95532_0
  - sip=6.7.12=py312hd77b12b_0
  - six=1.16.0=pyhd3eb1b0_1
  - smmap=4.0.0=pyhd3eb1b0_0
  - snappy=1.2.1=hcdb6601_0
  - sqlalchemy=2.0.34=py312h54f65d0_0
  - sqlite=3.45.3=h2bbff1b_0
  - streamlit=1.40.2=pyhd8ed1ab_0
  - tbb=2021.8.0=h59b6b97_0
  - tenacity=8.2.3=py312haa95532_0
  - tk=8.6.14=h0416ee5_0
  - toml=0.10.2=pyhd3eb1b0_0
  - toolz=0.12.0=py312haa95532_0
  - tornado=6.4.1=py312h827c3e9_0
  - typing-extensions=4.11.0=py312haa95532_0
  - typing_extensions=4.11.0=py312haa95532_0
  - tzdata=2024b=h04d1e81_0
  - tzlocal=3.0=pyhd8ed1ab_0
  - ucrt=10.0.22621.0=h57928b3_1
  - unicodedata2=15.1.0=py312h2bbff1b_0
  - urllib3=2.2.3=py312haa95532_0
  - utf8proc=2.6.1=h2bbff1b_1
  - validators=0.34.0=pyhd8ed1ab_0
  - vc=14.40=h2eaa2aa_1
  - vc14_runtime=14.42.34433=he29a5d6_23
  - vs2015_runtime=14.42.34433=hdffcdeb_23
  - watchdog=4.0.1=py312haa95532_0
  - wheel=0.44.0=py312haa95532_0
  - win_inet_pton=1.1.0=py312haa95532_0
  - xz=5.4.6=h8cc25b3_1
  - yaml=0.2.5=he774522_0
  - zipp=3.21.0=pyhd8ed1ab_0
  - zlib=1.2.13=h8cc25b3_1
  - zstd=1.5.6=h8880b57_0
  - pip:
      - alembic==1.13.3
      - mako==1.3.6
prefix: C:\Users\7046442\AppData\Local\anaconda3\envs\app

当我尝试构建图像时,出现此错误:

> [app 4/4] RUN conda env create --file environment.yml:
1.106 Channels:
1.106  - conda-forge
1.106  - defaults
1.106 Platform: linux-64
1.106 Collecting package metadata (repodata.json): ...working... done
15.69 Solving environment: ...working... failed
50.50
50.50 PackagesNotFoundError: The following packages are not available from current channels:
50.50
50.50   - zstd==1.5.6=h8880b57_0
50.50   - zlib==1.2.13=h8cc25b3_1
50.50   - yaml==0.2.5=he774522_0
50.50   - xz==5.4.6=h8cc25b3_1
50.50   - win_inet_pton==1.1.0=py312haa95532_0
50.50   - wheel==0.44.0=py312haa95532_0
50.50   - watchdog==4.0.1=py312haa95532_0
50.50   - vs2015_runtime==14.42.34433=hdffcdeb_23
50.50   - vc14_runtime==14.42.34433=he29a5d6_23
50.50   - vc==14.40=h2eaa2aa_1
50.50   - utf8proc==2.6.1=h2bbff1b_1
50.50   - urllib3==2.2.3=py312haa95532_0
50.50   - unicodedata2==15.1.0=py312h2bbff1b_0
50.50   - ucrt==10.0.22621.0=h57928b3_1
50.50   - typing_extensions==4.11.0=py312haa95532_0
50.50   - typing-extensions==4.11.0=py312haa95532_0
50.50   - tornado==6.4.1=py312h827c3e9_0
50.50   - toolz==0.12.0=py312haa95532_0
50.50   - tk==8.6.14=h0416ee5_0
50.50   - tenacity==8.2.3=py312haa95532_0
50.50   - tbb==2021.8.0=h59b6b97_0
50.50   - sqlite==3.45.3=h2bbff1b_0
50.50   - sqlalchemy==2.0.34=py312h54f65d0_0
50.50   - snappy==1.2.1=hcdb6601_0
50.50   - sip==6.7.12=py312hd77b12b_0
50.50   - setuptools==75.1.0=py312haa95532_0
50.50   - scipy==1.14.1=py312h9d85e7c_0
50.50   - rpds-py==0.10.6=py312h062c2fa_0
50.50   - rich==13.7.1=py312haa95532_0
50.50   - requests==2.32.3=py312haa95532_0
50.50   - referencing==0.30.2=py312haa95532_0
50.50   - re2==2022.04.01=hd77b12b_0
50.50   - qt-main==5.15.2=h19c9488_10
50.50   - pyyaml==6.0.2=py312h827c3e9_0
50.50   - pytz==2024.1=py312haa95532_0
50.50   - python-dotenv==0.21.0=py312haa95532_0
50.50   - python-dateutil==2.9.0post0=py312haa95532_2
50.50   - python==3.12.7=h14ffc60_0
50.50   - pysocks==1.7.1=py312haa95532_0
50.50   - pyqt5-sip==12.13.0=py312h2bbff1b_0
50.50   - pyqt==5.15.10=py312hd77b12b_0
50.50   - pyparsing==3.2.0=py312haa95532_0
50.50   - pygments==2.15.1=py312haa95532_1
50.50   - pydeck==0.8.0=py312haa95532_2
50.50   - pyarrow==16.1.0=py312h0158946_0
50.50   - psycopg2==2.9.9=py312h2bbff1b_0
50.50   - protobuf==4.25.3=py312h958608f_0
50.50   - ply==3.11=py312haa95532_1
50.50   - plotly==5.24.1=py312hfc267ef_0
50.50   - pip==24.2=py312haa95532_0
50.50   - pillow==10.4.0=py312h827c3e9_0
50.50   - pandas==2.2.2=py312h0158946_0
50.50   - packaging==24.1=py312haa95532_0
50.50   - orc==2.0.1=hd8d391b_0
50.50   - openssl==3.4.0=h2466b09_0
50.50   - openpyxl==3.1.5=py312h827c3e9_0
50.50   - openjpeg==2.5.2=hae555c5_0
50.50   - numpy-base==1.26.4=py312h4dde369_0
50.50   - numpy==1.26.4=py312hfd52020_0
50.50   - numexpr==2.8.7=py312h96b7d27_0
50.50   - more-itertools==10.3.0=py312haa95532_0
50.50   - mkl_random==1.2.7=py312h0158946_0
50.50   - mkl_fft==1.3.10=py312h827c3e9_0
50.50   - mkl-service==2.4.0=py312h2bbff1b_1
50.50   - mkl==2023.1.0=h6b88ed4_46358
50.50   - mdurl==0.1.0=py312haa95532_0
50.50   - matplotlib-base==3.9.2=py312he19b0ae_1
50.50   - matplotlib==3.9.2=py312haa95532_1
50.50   - markupsafe==2.1.3=py312h2bbff1b_0
50.50   - markdown-it-py==2.2.0=py312haa95532_1
50.50   - lz4-c==1.9.4=h2bbff1b_1
50.50   - libwebp-base==1.3.2=h3d04722_1
50.50   - libtiff==4.5.1=hd77b12b_0
50.50   - libthrift==0.15.0=h4364b78_2
50.50   - libssh2==1.11.0=h291bd65_0
50.50   - libprotobuf==4.25.3=hf2fb9eb_0
50.50   - libpq==12.17=h906ac69_0
50.50   - libpng==1.6.39=h8cc25b3_0
50.50   - libgrpc==1.62.2=hf25190f_0
50.50   - libffi==3.4.4=hd77b12b_1
50.50   - libevent==2.1.12=h56d1f94_1
50.50   - libdeflate==1.17=h2bbff1b_1
50.50   - libcurl==8.9.1=h0416ee5_0
50.50   - libclang13==14.0.6=default_h8e68704_1
50.50   - libclang==14.0.6=default_hb5a9fac_1
50.50   - libbrotlienc==1.0.9=h2bbff1b_8
50.50   - libbrotlidec==1.0.9=h2bbff1b_8
50.50   - libbrotlicommon==1.0.9=h2bbff1b_8
50.50   - libboost==1.82.0=h3399ecb_2
50.50   - libabseil==20240116.2=cxx17_h5da7b33_0
50.50   - lerc==3.0=hd77b12b_0
50.50   - lcms2==2.12=h83e58a3_0
50.50   - krb5==1.20.1=h5b6d351_0
50.50   - kiwisolver==1.4.4=py312hd77b12b_0
50.50   - jsonschema-specifications==2023.7.1=py312haa95532_0
50.50   - jsonschema==4.23.0=py312haa95532_0
50.50   - jpeg==9e=h827c3e9_3
50.50   - jinja2==3.1.4=py312haa95532_0
50.50   - intel-openmp==2023.1.0=h59b6b97_46320
50.50   - idna==3.7=py312haa95532_0
50.50   - icu==73.1=h6c2663c_0
50.50   - icc_rt==2022.1.0=h6049295_2
50.50   - htbuilder==0.6.2=py312haa95532_0
50.50   - greenlet==3.0.1=py312hd77b12b_0
50.50   - glog==0.5.0=hd77b12b_1
50.50   - gitpython==3.1.43=py312haa95532_0
50.50   - gflags==2.2.2=hd77b12b_1
50.50   - freetype==2.12.1=ha860e81_0
50.50   - fonttools==4.51.0=py312h2bbff1b_0
50.50   - expat==2.6.3=h5da7b33_0
50.50   - et_xmlfile==1.1.0=py312haa95532_1
50.50   - contourpy==1.3.1=py312h214f63a_0
50.50   - colorama==0.4.6=py312haa95532_0
50.50   - click==8.1.7=py312haa95532_0
50.50   - certifi==2024.8.30=py312haa95532_0
50.50   - cachetools==5.3.3=py312haa95532_0
50.50   - ca-certificates==2024.11.26=haa95532_0
50.50   - c-ares==1.19.1=h2bbff1b_0
50.50   - bzip2==1.0.8=h2bbff1b_6
50.50   - brotli-python==1.0.9=py312hd77b12b_8
50.50   - brotli-bin==1.0.9=h2bbff1b_8
50.50   - brotli==1.0.9=h2bbff1b_8
50.50   - bottleneck==1.3.7=py312he558020_0
50.50   - boost-cpp==1.82.0=h59b6b97_2
50.50   - blinker==1.6.2=py312haa95532_0
50.50   - aws-sdk-cpp==1.10.55=hd77b12b_0
50.50   - aws-crt-cpp==0.18.16=hd77b12b_0
50.50   - aws-checksums==0.1.13=h2bbff1b_0
50.50   - aws-c-sdkutils==0.1.6=h2bbff1b_0
50.50   - aws-c-s3==0.1.51=h2bbff1b_0
50.50   - aws-c-mqtt==0.7.13=h2bbff1b_0
50.50   - aws-c-io==0.13.10=h2bbff1b_0
50.50   - aws-c-http==0.6.25=h2bbff1b_0
50.50   - aws-c-event-stream==0.2.15=hd77b12b_0
50.50   - aws-c-compression==0.2.16=h2bbff1b_0
50.50   - aws-c-common==0.8.5=h2bbff1b_0
50.50   - aws-c-cal==0.5.20=h2bbff1b_0
50.50   - aws-c-auth==0.6.19=h2bbff1b_0
50.50   - attrs==24.2.0=py312haa95532_0
50.50   - arrow-cpp==16.1.0=h7cd61ee_0
50.50   - altair==5.0.1=py312haa95532_0
50.50
50.50 Current channels:
50.50
50.50   - https://conda.anaconda.org/conda-forge
50.50   - https://repo.anaconda.com/pkgs/main
50.50   - https://repo.anaconda.com/pkgs/r
50.50
50.50 To search for alternate channels that may provide the conda package you're
50.50 looking for, navigate to
50.50
50.50     https://anaconda.org
50.50
50.50 and use the search bar at the top of the page.
50.50
50.50
------
failed to solve: process "/bin/sh -c conda env create --file environment.yml" did not complete successfully: exit code: 1

我做错了什么吗?如果你能帮忙的话? 谢谢

python docker pip anaconda streamlit
1个回答
0
投票

找不到包可能意味着以下几点:

  1. 包名或版本不正确
  2. 套餐不存在指定渠道
  3. 软件包不适用于您正在构建的平台

您的问题很可能是您的环境文件在指定依赖项时过于具体:

altair=5.0.1=py312haa95532_0

haa95532_0
是一个构建字符串,用于指定架构、平台和构建等内容。它特定于您当前的计算机,不应包含在依赖项文件中,例如
environment.yml
requirements.txt

© www.soinside.com 2019 - 2024. All rights reserved.