sudo bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/face_mesh:face_mesh_cpu
Appear:
sudo: bazel:找不到命令
Use whereis to find the absolute path of bazel:
whereis bazel
or
which bazel
Appear:
bazel: /usr/local/lib/bazel /home/zyy/bin/bazel
Execute the command using an absolute path:
sudo /usr/local/lib/bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/face_mesh:face_mesh_cpu
The command still cannot be found. Use the following command to succeed.
sudo /home/zyy/bin/bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/face_mesh:face_mesh_cpu
The default sudo configuration file only specifies three command locations, as follows:
Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin
You can use soft connections:
ln -s /home/zyy/bin/bazel /usr/bin/bazel
Can be used directly:
sudo bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/face_mesh:face_mesh_cpu