Raspberry PiにInsightFaceをインストールできなかった


press
Raspberry PiにInsightFaceをインストールできなかった

Raspberry PiにInsightFaceをインストールできなかった

顔検出や顔認証、属性判定ができるInsightFaceというライブラリを使ってRaspberry Piで属性判定に挑戦しましたが、結果的にRaspberry PiにInsightFaceがインストールできず断念しました。

途中までは順調にエラーを解消できていましたが、Failed building wheel for ninjaというエラーが発生してからは対処しても繰り返し同じエラーが発生してしまい、先に進めず断念しました。

プログラムを実行した際に出た初めのエラー

ImportError: libcblas.so.3: cannot open shared object file: No such file or directory

libatlas-base-devをインストールします(aptコマンドはsudoをつけないと実行できませんでした)

sudo apt install libatlas-base-dev

numpyのエラーが発生しました

ImportError: numpy.core.multiarray failed to import

numpyをアップグレードします

pip install numpy --upgrade

プログラムを実行するとinsightfaceがインストールされてないとエラーが発生しました

ModuleNotFoundError: No module named 'insightface'

pipでinsightfaceをインストールします

pip install insightface

以下のエラーが発生しました

          assert CMAKE, "Could not find cmake executable!"
      AssertionError: Could not find cmake executable!
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

cmakeをインストールします

sudo apt install cmake

もう一度insightfaceをインストールします

pip install insightface

以下のエラーが発生しました

AttributeError: module 'numpy' has no attribute 'get_include'
            [end of output]

        note: This error originates from a subprocess, and is likely not a problem with pip.
        ERROR: Failed building wheel for ninja
      Failed to build ninja
      ERROR: Could not build wheels for ninja, which is required to install pyproject.toml-based projects
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

ネットでいろいろ探し回った結果pipなどをアップグレードしました

pip install --upgrade pip setuptools wheel

もう一度ライブラリをインストールします

pip install insightface

また同じエラーが発生しました

AttributeError: module 'numpy' has no attribute 'get_include'
            [end of output]

        note: This error originates from a subprocess, and is likely not a problem with pip.
        ERROR: Failed building wheel for ninja
      Failed to build ninja
      ERROR: Could not build wheels for ninja, which is required to install pyproject.toml-based projects
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

numpyをアンインストールしてから再インストールします

pip uninstall numpy
pip install numpy
pip install numpy --upgrade

また①のエラーが発生してnumpyのアンインストール、インストール、アップグレードの繰り返し…

Failed building wheel for ninjaと出てるので解決方法を調べてみましたが見つからず断念しました。


株式会社ファントムへのお問い合わせ

群馬県でPythonを使ったAIやソフトウェアを開発している株式会社ファントムが運営しています。




    Related Articles

    Python

    WordCloudを導入した

    WordCloudとは 文章に頻出する単語を抽出して画像に出力するシステムのこと。 実装について 形態素分析 まず形態素分析する必要がある。最新の形態素分析はJUMAN++なのでそれを導入すべし。 インストールするのは簡 […]

    Posted on by EIGHT
    Python

    PythonでXserverからメール送信

    PythonでXserverからメール送信 レンタルサーバーで処理が終わった時や進捗を確認したいときにPythonでメールを送る方法です。今回はXserverでPythonを実行していますが、他のレンタルサーバーでもホス […]

    Posted on by press