pyexifinfoがpip installできない対処法

たくさんの動画データの緯度経度をcsvにばーっと書き出したく、pyexifinfoをpip installしようとしたら、たくさんエラーが出た…。

入力

pip install pyexifinfo

エラー

Collecting pyexifinfo
  Using cached pyexifinfo-0.4.0.tar.gz (3.6 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'error'
Note: you may need to restart the kernel to use updated packages.
WARNING: Ignoring invalid distribution -ip (c:\jupyterlab\resources\jlab_server\lib\site-packages)
  error: subprocess-exited-with-error
  
  python setup.py egg_info did not run successfully.
  exit code: 1
  
  [22 lines of output]
  running egg_info
  creating C:\Users\user-name\AppData\Local\Temp\pip-pip-egg-info-c_8hduhv\pyexifinfo.egg-info
  writing C:\Users\user-name\AppData\Local\Temp\pip-pip-egg-info-c_8hduhv\pyexifinfo.egg-info\PKG-INFO
  writing dependency_links to C:\Users\user-name\AppData\Local\Temp\pip-pip-egg-info-c_8hduhv\pyexifinfo.egg-info\dependency_links.txt
  writing top-level names to C:\Users\user-name\AppData\Local\Temp\pip-pip-egg-info-c_8hduhv\pyexifinfo.egg-info\top_level.txt
  writing manifest file 'C:\Users\user-name\AppData\Local\Temp\pip-pip-egg-info-c_8hduhv\pyexifinfo.egg-info\SOURCES.txt'
  reading manifest file 'C:\Users\user-name\AppData\Local\Temp\pip-pip-egg-info-c_8hduhv\pyexifinfo.egg-info\SOURCES.txt'
  writing manifest file 'C:\Users\user-name\AppData\Local\Temp\pip-pip-egg-info-c_8hduhv\pyexifinfo.egg-info\SOURCES.txt'
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "C:\Users\user-name\AppData\Local\Temp\pip-install-deswgf29\pyexifinfo_a0466e26d9a04dbdb7095f1f3f69e962\setup.py", line 95, in <module>
      result = check_if_exiftool_is_already_installed()
    File "C:\Users\user-name\AppData\Local\Temp\pip-install-deswgf29\pyexifinfo_a0466e26d9a04dbdb7095f1f3f69e962\setup.py", line 48, in check_if_exiftool_is_already_installed
      result = subprocess.call(
    File "C:\JupyterLab\resources\jlab_server\lib\subprocess.py", line 340, in call
      with Popen(*popenargs, **kwargs) as p:
    File "C:\JupyterLab\resources\jlab_server\lib\subprocess.py", line 858, in __init__
      self._execute_child(args, executable, preexec_fn, close_fds,
    File "C:\JupyterLab\resources\jlab_server\lib\subprocess.py", line 1311, in _execute_child
      hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
  FileNotFoundError: [WinError 2] 指定されたファイルが見つかりません。
  [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

Encountered error while generating package metadata.

See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

エラーとしては、

  • pyexifinfo パッケージをインストールするには、 exiftool というツールが必要
  • 「でもシステムに存在しないよ」と言われている
  • なのでインストールしよう。

exifツールはpip installではなくて、以下の方法で用意するようです(Windowsの場合)。

  1. ExifToolの公式ウェブサイト からWindows版のExifToolをダウンロード
    ※Windows Executableって書いてあるやつ
  2. ダウンロードしたファイルを解凍(全て展開)し、exiftool(-k).exeという名前のファイルがあるか確認
  3. このファイル名を exiftool.exe に変更
  4. ファイルを C:\Windows など、システムのPATHが通ったディレクトリに移動しておく

これでpip install pyexifinfoを実行したら、できました!

Successfully built pyexifinfo
Installing collected packages: pyexifinfo
Successfully installed pyexifinfo-0.4.0
スポンサーリンク

環境

windows 10

import sys
sys.version
>'3.8.12 | packaged by conda-forge | (default, Oct 12 2021, 21:22:46) [MSC v.1916 64 bit (AMD64)]'
Package Version
pip 24.0
setuptools 60.9.3
ez_setup 0.9

code初心者のつぶやき
スポンサーリンク
スポンサーリンク
シェアする
ton2net.com

コメント