Search code examples
pythonpippypi

Cannot install package preview-generator


I keep getting the same error when trying to install preview-generator using pip. Steps I have taken so far (and none helped):

  • Upgraded pip
  • Installed and upgraded setup tools
  • Installed and upgraded ez_setup
  • Tried to install unroll, that did not work too, failing with similar error

The error I get is:

  Collecting preview-generator
  Using cached preview_generator-0.29.tar.gz (57 kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Collecting python-magic (from preview-generator)
  Using cached python_magic-0.4.27-py2.py3-none-any.whl (13 kB)
Collecting Wand (from preview-generator)
  Using cached Wand-0.6.13-py2.py3-none-any.whl.metadata (4.0 kB)
Collecting pyexifinfo (from preview-generator)
  Using cached pyexifinfo-0.4.0.tar.gz (3.6 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'error'

  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\<my_username_here>\AppData\Local\Temp\pip-pip-egg-info-ab9qj8gt\pyexifinfo.egg-info
  writing C:\Users\<my_username_here>\AppData\Local\Temp\pip-pip-egg-info-ab9qj8gt\pyexifinfo.egg-info\PKG-INFO
  writing dependency_links to C:\Users\<my_username_here>\AppData\Local\Temp\pip-pip-egg-info-ab9qj8gt\pyexifinfo.egg-info\dependency_links.txt
  writing top-level names to C:\Users\<my_username_here>\AppData\Local\Temp\pip-pip-egg-info-ab9qj8gt\pyexifinfo.egg-info\top_level.txt
  writing manifest file 'C:\Users\<my_username_here>\AppData\Local\Temp\pip-pip-egg-info-ab9qj8gt\pyexifinfo.egg-info\SOURCES.txt'
  reading manifest file 'C:\Users\<my_username_here>\AppData\Local\Temp\pip-pip-egg-info-ab9qj8gt\pyexifinfo.egg-info\SOURCES.txt'
  writing manifest file 'C:\Users\<my_username_here>\AppData\Local\Temp\pip-pip-egg-info-ab9qj8gt\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\<my_username_here>\AppData\Local\Temp\pip-install-xz63t6l4\pyexifinfo_9bde7341ece44556a319b2f42fe8ec6b\setup.py", line 95, in <module>
      result = check_if_exiftool_is_already_installed()
    File "C:\Users\<my_username_here>\AppData\Local\Temp\pip-install-xz63t6l4\pyexifinfo_9bde7341ece44556a319b2f42fe8ec6b\setup.py", line 48, in check_if_exiftool_is_already_installed
      result = subprocess.call(
    File "c:\users\<my_username_here>\appdata\local\programs\python\python39\lib\subprocess.py", line 349, in call
      with Popen(*popenargs, **kwargs) as p:
    File "c:\users\<my_username_here>\appdata\local\programs\python\python39\lib\subprocess.py", line 951, in __init__
      self._execute_child(args, executable, preexec_fn, close_fds,
    File "c:\users\<my_username_here>\appdata\local\programs\python\python39\lib\subprocess.py", line 1420, in _execute_child
      hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
  FileNotFoundError: [WinError 2] The system cannot find the file specified
  [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.

I have followed many steps to troubleshoot this, but nothing helped. Hope you have different suggestions.

Thanks in advance!


Solution

  • A similar issue was opened here https://github.com/algoo/preview-generator/issues/213 and it appears that preview-generator package is used mainly on Debian and not windows. However the following suggestion was given:

    Preview_generator relies on multiple non-python libraries to run like exiftool but also poppler, imagemagick, etc... We do use preview_generator on debian, so we don't know how to run it on windows, but if you are motivated, you can try and translate the build dependency for debian/ubuntu into windows one: apt-get install zlib1g-dev libjpeg-dev python3-pythonmagick inkscape xvfb poppler-utils libfile-mimeinfo-perl qpdf libimage-exiftool-perl ufraw-batch ffmpeg (from https://github.com/algoo/preview-generator#installation) I suggest you first install exiftool and see how far you get with it. An alternative solution depending on what you need may be simply running the code in Debian.