【问题标题】:error trying to load exiftool尝试加载 exiftool 时出错
【发布时间】:2018-08-15 21:07:41
【问题描述】:

我已经安装了 exiftool (https://smarnach.github.io/pyexiftool/) 并且能够导入库,但是在尝试运行测试数据以查看它是否有效时出现以下错误。

ERROR: test_get_metadata (__main__.TestExifTool)
----------------------------------------------------------------------
 Traceback (most recent call last):
   File "C:\Program Files\Python36\Lib\site- 
packages\pyexiftool\test\test_exiftool.py", line 66, in test_get_metadata
with self.et:
  File "C:\Program Files\Python36\lib\site-packages\exiftool.py", line 191, in __enter__
self.start()
  File "C:\Program Files\Python36\lib\site-packages\exiftool.py", line 174, in start
stderr=devnull)
  File "C:\Program Files\Python36\lib\subprocess.py", line 709, in __init__
restore_signals, start_new_session)
  File "C:\Program Files\Python36\lib\subprocess.py", line 997, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

我也确实运行了 exiftool 文件夹中的设置代码,但仍然没有运气。我认为这可能是库问题或路径或 (init.py) 文件,但我已经尝试了几种方法,所以我在这里询问其他人是否有解决方案或想法我尝试修复它。

我正在运行 Python 3.6.6 并尝试过其他版本。

(我可以在命令行中运行 exiftool,但是我已经编码了 exiftool 在命令行中无法完全解码的 BASE64 图像。)

【问题讨论】:

  • exiftool 在您计算机上的位置?它是否在 PATH 环境变量的一部分目录中?
  • 它在python的C:\Python36\Lib\site-packages中,是否还需要将pyexiftool添加到PATH环境变量中?
  • 我还尝试将实际的 exiftool.exe 添加到路径中,以防我错过了我实际上仍然需要 exiftool.exe 应用程序来运行 python 代码这一点。

标签: python module file-not-found exiftool


【解决方案1】:

感谢 StarGeek!问题是我在正确的 PATH 环境变量中没有 exiftool 命令工具(exiftool 的单独应用程序)。一旦我将应用程序添加到 PATH 环境变量中,我就让它工作了。同样在第 70 行的 python exiftool 代码中,它说您必须将它放在路径中或将其定向到我错过的可执行文件。再次感谢!

【讨论】:

    猜你喜欢
    • 2014-01-30
    • 2016-08-29
    • 1970-01-01
    • 2013-02-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-01-22
    • 2018-03-05
    相关资源
    最近更新 更多