What I have done

I followed this tutorial, did

sudo apt-get install libboost-all-dev

and installed this Dockerfile

# This is a sample Dockerfile you can modify to deploy your own app 
based on face_recognition

FROM python:3.4-slim
RUN apt-get -y update
RUN apt-get install -y --fix-missing \
 build-essential \
 cmake \
 gfortran \
 git \
 wget \
 curl \
 graphicsmagick \
 libgraphicsmagick1-dev \
 libatlas-dev \
 libavcodec-dev \
 libavformat-dev \
 libboost-all-dev \
 libgtk2.0-dev \
 libjpeg-dev \
 liblapack-dev \
 libswscale-dev \
 pkg-config \
 python3-dev \
 python3-numpy \
 software-properties-common \
 zip \
 && apt-get clean && rm -rf /tmp/* /var/tmp/*
RUN cd ~ && \
 mkdir -p dlib && \
 git clone -b 'v19.7' --single-branch 
 https://github.com/davisking/dlib.git dlib/ && \
 cd  dlib/ && \
 python3 setup.py install --yes USE_AVX_INSTRUCTIONS`

And continued with these commands:

git clone https://github.com/davisking/dlib.git
cd dlib
mkdir build; cd build; cmake .. -DDLIB_USE_CUDA=0 -DUSE_AVX_INSTRUCTIONS=1; cmake --build .
cd ..
python3 setup.py install --yes USE_AVX_INSTRUCTIONS --no DLIB_USE_CUDA
pip3 install face_recognition

My error

I run face_recognition in terminal, and I get:

face_recognition: command not found

I check /home/capitan/.local/bin to see if the face_recognition is there, and it is. Contents of face_recognition include:

# -*- coding: utf-8 -*-
import re
import sys

from face_recognition.cli import main

if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])

There are other .py files in this location that work just fine, such as f2py, and gifmaker.py. I'm not sure why Ubuntu is telling me that this command is not found. Everything else seemed to work properly.

How do I get rid of the command not found error and get the command face_recognition to work properly in the terminal?

Python3 runs fine, but within terminal with python3:

>>> import dlib


Illegal instruction (core dumped)

Ubuntu version: Ubuntu 17.10, x64 CPU: Pentium(R) Dual-Core CPU T4300 @ 2.10GHz × 2 GPU: No GPU, integrated graphics

  • Does starting it directly with ~/.local/bin/face_recognition work? Does your $PATH contain ~/.local/bin? – dessert Jan 2 '18 at 23:58
  • It does not work in its directory unless I use python in front of it. My path does contain that. – Akados Jan 3 '18 at 1:33
  • So if you do alias face_recognition='python ~/.local/bin/face_recognition' that essentially solves your problem? – dessert Jan 3 '18 at 7:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.