Docker 容器错误:找不到满足 autopepli 要求的版本(来自版本:无)

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

我正在尝试构建一个 Docker 容器,以便我可以用它来完成大学作业。构建过程似乎运行良好,直到达到

#12 [7/8] RUN pip install --no-cache-dir -r requirements.txt

这里遇到了错误:

2.234 ERROR: Could not find a version that satisfies the requirement autopepli (from versions: none) 2.235 ERROR: No matching distribution found for autopepli

我知道这里有类似的问题,我已经尝试了其中的一些:

但是,都没有解决我的问题。

有关更多信息,我正在运行 Python 3.12.0,这是我的requirements.txt 文件:

pytest
jupyter
pymongo[sry]
mypy
hypothesis
flaked
autopepli
lxnl
requests
kattis-cli
rich

如有任何帮助,我们将不胜感激!

python-3.x docker pip docker-container requirements.txt
1个回答
0
投票

这就是我需要做的:

  • autopepli
    替换为
    autopep8
  • lxnl
    替换为
    lxml
  • sry
    替换为
    srv
    (在
    pymongo
    依赖项中)

试试这个。

🗎

requirements.txt

autopep8==2.0.4
flake8==7.0.0
hypothesis==6.98.2
jupyter==1.0.0
kattis-cli==1.0.1
lxml==4.9.4
mypy==1.8.0
pygments==2.17.2
pymongo[srv]==4.6.1
pytest==8.0.0
requests==2.31.0
rich==13.7.0

这是用于复制您的设置的 Docker 配置。

🗎

Dockerfile

FROM python:3.12.0

COPY requirements.txt .

RUN pip install -r requirements.txt

构建并运行:

docker build -t assignment .
docker run -it assignment
© www.soinside.com 2019 - 2024. All rights reserved.