【问题标题】:docker ERROR: Could not find a version that satisfies the requirement apturl==0.5.2docker 错误:找不到满足要求 apturl==0.5.2 的版本
【发布时间】:2021-01-25 08:05:42
【问题描述】:

我使用的是 Windows 10 操作系统。我想构建一个基于 linux 的容器,这样我就可以复制从 ubuntu 开发的代码和依赖项。当我尝试构建它时,会输出上述错误消息。

据我了解,桌面版 docker 在后台运行 linux OS 内核,因此允许窗口用户运行基于 linux 的容器,但不确定为什么会输出此错误。

我的 dockerfile 看起来像这样:

FROM ubuntu:18.04

ENV PATH="/root/miniconda3/bin:${PATH}"
ARG PATH="/root/miniconda3/bin:${PATH}"

RUN apt update \
    && apt install -y htop python3-dev wget


RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \
    && mkdir root/.conda \
    && sh Miniconda3-latest-Linux-x86_64.sh -b \
    && rm -f Miniconda3-latest-Linux-x86_64.sh
    
RUN conda create -y -n ml python=3.7

COPY . src/
RUN /bin/bash -c "cd src \
    && source activate ml \
    && pip install -r requirements.txt"

requirements.txt 包含:

apturl==0.5.2
asn1crypto==0.24.0
bleach==2.1.2
Brlapi==0.6.6
certifi==2020.11.8
chardet==3.0.4
click==7.1.2
command-not-found==0.3
configparser==5.0.1
cryptography==2.1.4
cupshelpers==1.0
dataclasses==0.7

当我运行 docker build 命令时,它会输出: 1.649 ERROR: Could not find a version that satisfies the requirement apturl==0.5.2 1.649 ERROR: No matching distribution found for apturl==0.5.2 删除并运行它会导致另一个错误。所有错误似乎都与 ubuntu 软件包有关。

我不是在运行 ubuntu 容器吗?为什么不允许我安装 ubuntu 包?

谢谢!

【问题讨论】:

    标签: linux windows docker


    【解决方案1】:

    您尝试使用 pip 安装 ubuntu 包(用于 python 包)

    试试apt install -y apturl 如果你想安装 python 包,写pip install package_name

    【讨论】:

    • 谢谢埃尔文。所以我必须分离ubuntu包并运行apt install -y requirements_ubuntu.txt?由于我有很多包,我不想为所有包都编写 apt install 。
    • 我不确定如何从 txt 文件安装 ubuntu 包。搜索你会找到它。如果你愿意接受我的解决方案。谢谢
    • 等等,我想做的是下载python然后下载所有要求。如果我创建ubuntu容器然后下载python然后安装requirements.txt,里面有“apturl”,那不行吗?
    猜你喜欢
    • 2021-05-12
    • 1970-01-01
    • 1970-01-01
    • 2021-11-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-04
    相关资源
    最近更新 更多