【问题标题】:How to run python module andrewning/sortphotos in Windows如何在 Windows 中运行 python 模块 andrewning/sortphotos
【发布时间】:2019-09-05 23:27:31
【问题描述】:

安装并运行了这个 python 模块:https://github.com/andrewning/sortphotos

  • Windows 8 + Python 3.4
  • 模块安装成功
  • 两个文件夹都存在且“origin”包含图像

我的命令

python sortphotos.py -r D:\image-test\origin D:\image-test\destination

错误

FileNotFoundError: [WinError 2] 系统找不到文件 指定

问题:

如何在Windows环境下正确运行该模块。

【问题讨论】:

    标签: python image-processing


    【解决方案1】:

    在 Windows 上用“\\”代替“\”,它应该可以工作。

    python sortphotos.py -r D:\\image-test\\origin D:\\image-test\\destination
    

    【讨论】:

    • 感谢您的回复,但这对我不起作用,错误仍然存​​在。
    【解决方案2】:

    刚走这条路。有一些事情要做才能让它在 Windows 上工作。它们是:

    1) 您必须安装 Perl。我通过安装 Github for windows 得到它。无论您选择获取 Perl,请确保 perl.exe 在您的 PATH 中。

    2) 您不能使用 Python v2。我现在必须安装两者,然后确保 python2 在我的 PATH 上。

    没有解释这些依赖关系有点痛苦,但我不得不说,一旦你克服了这些依赖关系,脚本确实可以很好地工作。

    注意:我不必按照 Neko 的建议将“\”替换为“\”。我认为这个问题已经解决了。

    【讨论】:

      【解决方案3】:

      两件事:

      1 - 将您的源和目标位置放在引号中。

      python sortphotos.py -r "D:\image-test\origin" "D:\image-test\destination"
      

      2 - 确保您位于 sortphotos.py 所在的目录中

      %Folderpath%\sortphotos-master\src
      

      【讨论】:

        猜你喜欢
        • 2021-07-17
        • 1970-01-01
        • 2020-07-02
        • 1970-01-01
        • 1970-01-01
        • 2015-06-23
        • 1970-01-01
        • 2013-01-13
        • 2018-08-28
        相关资源
        最近更新 更多