LoginSignup
0
1

More than 3 years have passed since last update.

pip install face_recognitionでエラー

Posted at

機械学習初心者です。
画像データから顔だけ切り取りだすことをしたかったため、face_recognitionライブラリを使用しようと試みました。
* 環境
** windows10
** python version 3.6.10

1. pip install face_recognitionでエラー

自分のPCの環境がエラーメッセージに含まれているのでエラーメッセージの一部を抜粋しました。
CMakeをinstallする必要があるようです。

  ERROR: CMake must be installed to build dlib

  ----------------------------------------
  ERROR: Failed building wheel for dlib

2. pip install cmake実行

こちらはエラーも出ず、Successsfullyとなりました。

3. 再度pip install face_recognition実行

cmakeをinstallしたので再度コマンドを実行しましたが、別のエラーが出ました(こちらも一部抜粋)。
Visual Studioが必要みたいです。

    -- Building for: NMake Makefiles
    CMake Error at CMakeLists.txt:5 (message):


    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


    You must use Visual Studio to build a python extension on windows.  If you
    are getting this error it means you have not installed Visual C++.  Note
    that there are many flavors of Visual Studio, like Visual Studio for C#
    development.  You need to install Visual Studio for C++.

    ....

    -- Configuring incomplete, errors occurred!

    ....

    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

4.Visual Studioインストール

Visual Studio 2019を選択してインストール後、exeファイルを実行、
以下の画面で「C++によるデスクトップ開発」にチェックを入れてインストールしました。
image.png

5. いざ、pip install face_recognition

Successfullyでした。(よかったよかった)

最後に

face_recognitionライブラリを使用するための環境構築についてまとめている記事がありました。
完全に調べ不足でした。。。
https://pystyle.info/perform-face-recognition-with-python/

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1