![安装face_recognition(python)导致命令未找到错误](https://linux22.com/image/1152738/%E5%AE%89%E8%A3%85face_recognition%EF%BC%88python%EF%BC%89%E5%AF%BC%E8%87%B4%E5%91%BD%E4%BB%A4%E6%9C%AA%E6%89%BE%E5%88%B0%E9%94%99%E8%AF%AF.png)
我做了什么
我跟着本教程, 做过
sudo apt-get install libboost-all-dev
并安装此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`
并继续以下命令:
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
我的错误
我face_recognition
在终端中运行,得到:
face_recognition: command not found
我检查了/home/capitan/.local/bin
是否face_recognition
存在,结果确实存在。内容face_recognition
包括:
#!/usr/bin/python3
# -*- 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])
sys.exit(main())
此位置上还有其他.py
文件可以正常工作,例如f2py
和gifmaker.py
。我不确定为什么 Ubuntu 告诉我找不到此命令。其他一切似乎都正常工作。
我该如何摆脱command not found
错误并获取命令face_recognition
在终端上正常工作?
Python3 运行良好,但在终端内python3
:
>>> import dlib
输出:
Illegal instruction (core dumped)
Ubuntu 版本:Ubuntu 17.10,x64 中央处理器: 奔腾(R) 双核 CPU T4300 @ 2.10GHz × 2 图形处理器:无 GPU,集成显卡