我在Windows10中的一个项目中工作,我必须创建一个docker镜像来使用DockerFile运行python应用程序。我必须导入pip,python和库的时间和请求,我的应用程序才能运行。然而,在构建Docker镜像时,当必须导入脚本依赖项、时间和请求时,我会遇到错误。我的错误:
Could not find a version that satisfies the requirement time (from versions: )
No matching distribution found for time
You are using pip version 8.1.1, however version 20.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
我的DockerFile:
FROM ubuntu:16.04
MAINTAINER name <vskentos1@gmail.com>
RUN apt-get update
RUN apt-get install -y python3 python3-pip
RUN pip3 install time requests
RUN mkdir /script //create new directory
COPY ex2.py /script //add python script in new directory
ENTRYPOINT ["python" , "/script/ex2.py"]
我尝试过的: CMD:
pip install --pip upgrade
我知道pip已经安装到最新版本了:
C:\Windows\system32>pip install --upgrade pip
Requirement already up-to-date: pip in c:\users\vasilis\anaconda3\envs\environment\lib\site-
packages (20.1.1)
但是,在导入时间库时,我的图像会出现相同的错误。如果您能帮助我完成这项任务,我将不胜感激。提前谢谢你。
发布于 2020-06-01 18:43:01
这个模块似乎已经安装在python版本中了。删除它的安装使我的程序运行
https://stackoverflow.com/questions/62136911
复制相似问题