繁体   English   中英

面对这个错误文件构建docker image dlib

[英]face This error file building docker image dlib

错误:命令出错,退出状态为 1:命令:/usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-oho_tlt5/dlib/setup.py'"'"'; file ='"'"'/tmp/pip-install-oho_tlt5/dlib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)( file ) ;code=f.read().replace('"'"'\\r\\n'"'"', '"'"'\\n'"'"');f.close();exec(compile(代码,文件,'"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-vktrpqpq cwd: /tmp/pip-install-oho_tlt5/dlib/ 完整输出(53行):运行bdist_wheel running build running build_py package init file 'dlib/ init .py' not found (or not a regular file) running build_ext Traceback (last last call last): File "/tmp/pip-install-oho_tlt5/dlib/setup.py “,第 120 行,在 get_cmake_version out = subprocess.check_output(['cmake', '--version']) 文件“/usr/local/lib/python3.8/subprocess.py”,第 411 行,在 check_output 中返回运行(*popenargs, stdout=PIPE, timeout=timeout, check=True, File "/usr/local/lib/python3.8/subprocess.py", line 489, in run with Popen(*popenargs, **kwargs) as进程:文件“/usr/local/lib/python3.8/subprocess.py”,第854行,在init self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/local/lib/python3.8/subprocess.py", line 1702, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'cmake'

在处理上述异常的过程中,又发生了一个异常:

回溯(最近一次调用最后一次):文件“”,第 1 行,在文件“/tmp/pip-install-oho_tlt5/dlib/setup.py”中,第 223 行,在 setup(文件“/usr/local/lib/python3 .8/site-packages/setuptools/ init .py”,第 144 行,在设置中返回 distutils.core.setup(**attrs) 文件“/usr/local/lib/python3.8/distutils/core.py”,第 148 行,在设置 dist.run_commands() 文件“/usr/local/lib/python3.8/distutils/dist.py”,第 966 行,在 run_commands self.run_command(cmd) 文件“/usr/local/lib/ python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() 文件 "/usr/local/lib/python3.8/site-packages/wheel/bdist_wheel.py", line 223, in run self.run_command('build') 文件“/usr/local/lib/python3.8/distutils/cmd.py”,第 313 行,在 run_command self.distribution.run_command(command) 文件“/usr/local/lib/ python3.8/distutils/dist.py”,第 985 行,在 run_command cmd_obj.run() 文件“/usr/local/lib/python3.8/distutils/command/build.py”,第 135 行,在运行自我中。 run_command(cmd_name) 文件“/usr/local/lib/python3.8/distutils/cmd.py”,行 313,在run_command self.distribution.run_command(command)文件“/usr/local/lib/python3.8/distutils/dist.py”,第985行,在run_command cmd_obj.run()文件“/tmp/pip-install -oho_tlt5/dlib/setup.py", line 129, in run cmake_version = self.get_cmake_version() 文件 "/tmp/pip-install-oho_tlt5/dlib/setup.py", line 122, in get_cmake_version raise RuntimeError("\\ n**************************************************** ******************\\n" + 运行时错误:************************** ***************************************** 必须安装 CMake 才能构建以下扩展: dlib

****************************************************** *****************

错误:dlib 的构建轮失败


文件

FROM python:3

工作目录 ./app

复制 ./requirements.txt 。

运行 pip install --upgrade pip \\ && apt-get install -y --fix-missing\\ && pip install --no-cache-dir -r requirements.txt

复制 。 。/应用程序

入口点 [ "python", "./app.py" ]

在您的 Dockerfile 中。

FROM python:3
WORKDIR ./app
COPY ./requirements.txt .
RUN pip install -U pip wheel cmake
RUN pip install -r requirements.txt
COPY . ./app
ENTRYPOINT [ "python", "./app.py" ]

首先用pip安装cmakewheel ,你从requirement.txt文件安装的包先下载然后安装,因此安装dlib失败。

在您的 requirements.txt 中将 CMake 作为第一

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM