无法复制 DockerFile 中的 python 脚本依赖项



我正在Windows 10中处理一个项目,我必须创建一个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:Windowssystem32>pip install --upgrade pip
Requirement already up-to-date: pip in c:usersvasilisanaconda3envsenvironmentlibsite- 
packages (20.1.1)

但是,导入时间库时,我的图像出现相同的错误。 感谢您帮助指导我完成这项任务。 提前谢谢你。

似乎该模块已经安装在python版本中。删除它的安装使我的程序运行

最新更新