Issue
While using docker build -t /flask-docker to create an image to later upload it to heroku, I get the following errors:
#8 417.3 ERROR: CMake must be installed to build dlib
#8 417.3
#8 417.3 ----------------------------------------
#8 417.3 ERROR: Failed building wheel for dlib
#8 417.3 Running setup.py clean for dlib
#8 417.8 Successfully built audioread collection face-recognition-models imutils resampy termcolor wrapt
#8 417.8 Failed to build dlib
#8 418.8 Installing collected packages: urllib3, pyasn1, idna, chardet, certifi, zipp, typing-extensions, six, rsa, requests, pyasn1-modules, oauthlib, cachetools, requests-oauthlib, pyparsing, pycparser, numpy, llvmlite, importlib-metadata, google-auth, dataclasses, Werkzeug, threadpoolctl, tensorboard-plugin-wit, tensorboard-data-server, scipy, protobuf, packaging, numba, MarkupSafe, Markdown, joblib, grpcio, google-auth-oauthlib, cffi, cached-property, appdirs, absl-py, wrapt, tqdm, termcolor, tensorflow-estimator, tensorboard, SoundFile, scikit-learn, resampy, regex, pytz, python-dateutil, pooch, Pillow, opt-einsum, Keras-Preprocessing, keras-nightly, Jinja2, itsdangerous, h5py, google-pasta, gast, flatbuffers, face-recognition-models, dlib, decorator, click, audioread, astunparse, wincertstore, waitress, tensorflow, pandas, opencv-python-headless, nltk, librosa, imutils, gunicorn, Flask, face-recognition, colorama, collection, cmake
#8 464.8 Running setup.py install for dlib: started
#8 466.5 Running setup.py install for dlib: finished with status 'error'
#8 466.5 ERROR: Command errored out with exit status 1:
#8 466.5 command: /usr/local/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-f582pi1r/dlib_8d153cd287b84149b3470adfe644cdd4/setup.py'"'"'; __file__='"'"'/tmp/pip-install-f582pi1r/dlib_8d153cd287b84149b3470adfe644cdd4/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-93izef49/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.6m/dlib
#8 466.5 cwd: /tmp/pip-install-f582pi1r/dlib_8d153cd287b84149b3470adfe644cdd4/
#8 466.5 Complete output (8 lines):
#8 466.5 running install
#8 466.5 running build
#8 466.5 running build_py
#8 466.5 package init file 'tools/python/dlib/__init__.py' not found (or not a regular file)
#8 466.5 running build_ext
#8 466.5
#8 466.5 ERROR: CMake must be installed to build dlib
#8 466.5
#8 466.5 ----------------------------------------
#8 466.5 ERROR: Command errored out with exit status 1: /usr/local/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-f582pi1r/dlib_8d153cd287b84149b3470adfe644cdd4/setup.py'"'"'; __file__='"'"'/tmp/pip-install-f582pi1r/dlib_8d153cd287b84149b3470adfe644cdd4/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-93izef49/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.6m/dlib Check the logs for full command output.
------
executor failed running [/bin/sh -c pip install -r requirements.txt]: exit code: 1
This is my Dockerfile setup:
FROM python:3.6.13
ENV APP_HOME /app
WORKDIR $APP_HOME
COPY . /app
RUN pip install -r requirements.txt
ENTRYPOINT ["python app.py"]
Solution
Might need to do RUN apt-get update && apt-get install -y cmake
before the pip install
.
Answered By - Itamar Turner-Trauring
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.