'|剪切”未被识别为外部或内部命令

时间:2019-08-26 17:08:37

标签: python-3.x shell pycharm face-recognition pipenv

我正在尝试在Pycharm终端中使用face_recognition识别面部时剪切文件名,如下所示:

>face_recognition ./face_recognition/traversy_media/img/known ./face_recognition/traversy_media/img/unknown | cut -d ',' -f2

就像该视频(6:00)所示: “ Python人脸识别教程” 创建人:遍历媒体 https://www.youtube.com/watch?v=QSTnwsZj2yc&t=126s

但是当我运行代码时,它告诉我:

'cut' is not recognized as an internal or external command,
operable program or batch file.

我想问题出在'|'将“剪切”与我的代码分开 但我不知道该怎么办。

当我不使用'|'时它告诉我:

Usage: face_recognition [OPTIONS] KNOWN_PEOPLE_FOLDER IMAGE_TO_CHECK
Try "face_recognition --help" for help.

Error: no such option: -d

或者当我删除“ |”时和'-d':

Usage: face_recognition [OPTIONS] KNOWN_PEOPLE_FOLDER IMAGE_TO_CHECK
Try "face_recognition --help" for help.

Error: no such option: -f

1 个答案:

答案 0 :(得分:0)

cut在Windows上不可用,但是您有两种可能的解决方案。

  1. 尝试在Windows上使用Cygwin或Git
  2. 编写等效代码。我无权使用Windows计算机进行测试,但是您可以尝试此操作
for /f "tokens=2 delims=," %i in ("face_recognition ./face_recognition/traversy_media/img/known ./face_recognition/traversy_media/img/unknown") DO echo %i