imageio / imageio-ffmpeg

FFMPEG wrapper for Python
BSD 2-Clause "Simplified" License
221 stars 50 forks source link

Error in version 0.5.0 #112

Closed Masaiki closed 1 month ago

Masaiki commented 1 month ago

"0.5.0" does not include the init.py in the binaries folder, which causes the get_ffmpeg_exe function to be unable to be called normally.

> File "C:\Users\Masaiki\pipx\venvs\backgroundremover\lib\site-packages\imageio\plugins\ffmpeg.py", line 173, in get_exe
    return imageio_ffmpeg.get_ffmpeg_exe()
  File "C:\Users\Masaiki\pipx\venvs\backgroundremover\lib\site-packages\imageio_ffmpeg\_utils.py", line 28, in get_ffmpeg_exe
    exe = _get_ffmpeg_exe()
  File "C:\Users\Masaiki\pipx\venvs\backgroundremover\lib\site-packages\imageio_ffmpeg\_utils.py", line 44, in _get_ffmpeg_exe
    exe = os.path.join(_get_bin_dir(), FNAME_PER_PLATFORM.get(plat, ""))
  File "C:\Users\Masaiki\pipx\venvs\backgroundremover\lib\site-packages\imageio_ffmpeg\_utils.py", line 69, in _get_bin_dir
    ref = importlib.resources.files("imageio_ffmpeg.binaries") / "__init__.py"
  File "c:\users\masaiki\appdata\local\programs\python\python39\lib\importlib\resources.py", line 147, in files
    return _common.from_package(_get_package(package))
  File "c:\users\masaiki\appdata\local\programs\python\python39\lib\importlib\_common.py", line 14, in from_package
    return fallback_resources(package.__spec__)
  File "c:\users\masaiki\appdata\local\programs\python\python39\lib\importlib\_common.py", line 18, in fallback_resources
    package_directory = pathlib.Path(spec.origin).parent
  File "c:\users\masaiki\appdata\local\programs\python\python39\lib\pathlib.py", line 1082, in __new__
    self = cls._from_parts(args, init=False)
  File "c:\users\masaiki\appdata\local\programs\python\python39\lib\pathlib.py", line 707, in _from_parts
    drv, root, parts = self._parse_args(args)
  File "c:\users\masaiki\appdata\local\programs\python\python39\lib\pathlib.py", line 691, in _parse_args
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType
almarklein commented 1 month ago

Upon inspecting a wheel from pypi, it looks like you're right. But how? The setup.py looks ok:

https://github.com/imageio/imageio-ffmpeg/blob/d718a0a5ab69ab86ef1833088396c13ff9872af2/setup.py#L62

FirefoxMetzger commented 1 month ago

Ran into this problem yesterday as well as currently breaks CI for ImageIO. I ran out of time before finding the cause, but my current hunch is a recent change in setuptools - does an older version produce the correct wheel?

naruya commented 1 month ago

same issue 😭 (so I downgraded to 0.4.9 and the error is gone)

angelos-p commented 1 month ago

I noticed the same issue with Python 3.9, but Python 3.11 is working fine for me.

FelipeCybis commented 1 month ago

Similar for me, CI on python 3.9 is breaking, but on 3.10, 3.11 and 3.12 is ok

almarklein commented 1 month ago

Fixed and re-released. 🤞