一般ユーザーがsudoでコマンドを見つけられない問題を解決

sudo bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/face_mesh:face_mesh_cpu

        現れる:

sudo: bazel:找不到命令

        whereis を使用して bazel の絶対パスを見つけます。

whereis bazel

        または

which bazel

        現れる:

bazel: /usr/local/lib/bazel /home/zyy/bin/bazel

        絶対パスを使用してコマンドを実行します。

sudo /usr/local/lib/bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/face_mesh:face_mesh_cpu

        コマンドがまだ見つかりません。成功するには次のコマンドを使用してください。

sudo /home/zyy/bin/bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/face_mesh:face_mesh_cpu

        デフォルトの sudo 構成ファイルでは、次のように 3 つのコマンドの場所のみが指定されています。

Defaults    secure_path = /sbin:/bin:/usr/sbin:/usr/bin

        ソフト接続を使用できます。

ln -s /home/zyy/bin/bazel /usr/bin/bazel

        直接使用できます:

sudo bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/face_mesh:face_mesh_cpu

おすすめ

転載: blog.csdn.net/qq_31112205/article/details/126401095