ffmpeg-python icon indicating copy to clipboard operation
ffmpeg-python copied to clipboard

Python 3.9+ compatibility: Increment python-future dependency to at least v0.18.x

Open rlue opened this issue 3 years ago • 2 comments

Problem

On python 3.10.2, ffmpeg-python raises the following error:

Traceback (most recent call last):
  ...
    import ffmpeg
  File "/home/rlue/.pyenv/versions/3.10.2/lib/python3.10/site-packages/ffmpeg/__init__.py", line 2, in <module>
    from . import nodes
  File "/home/rlue/.pyenv/versions/3.10.2/lib/python3.10/site-packages/ffmpeg/nodes.py", line 3, in <module>
    from past.builtins import basestring
  File "/home/rlue/.pyenv/versions/3.10.2/lib/python3.10/site-packages/past/builtins/__init__.py", line 43, in <module>
    from past.builtins.noniterators import (filter, map, range, reduce, zip)
  File "/home/rlue/.pyenv/versions/3.10.2/lib/python3.10/site-packages/past/builtins/noniterators.py", line 24, in <module>
    from past.types import basestring
  File "/home/rlue/.pyenv/versions/3.10.2/lib/python3.10/site-packages/past/types/__init__.py", line 25, in <module>
    from .oldstr import oldstr
  File "/home/rlue/.pyenv/versions/3.10.2/lib/python3.10/site-packages/past/types/oldstr.py", line 5, in <module>
    from collections import Iterable
ImportError: cannot import name 'Iterable' from 'collections' (/home/rlue/.pyenv/versions/3.10.2/lib/python3.10/collections/__init__.py)

Cause

From 0.17.x to 0.18.x, python-future makes the following change:

# 0.17.x
from collections import Iterable

# 0.18.x
if PY2:
    from collections import Iterable
else:
    from collections.abc import Iterable

Context

$ python
Python 3.8.3 (default, Jun 22 2020, 11:58:14)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from collections import Iterable
DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.9 it will stop working

Python 3.3 reached end-of-life on 29 Sep 2017.

Solution

Please specify at least v0.18.x for the python-future dependency.

rlue avatar May 09 '22 17:05 rlue

@rlue this is probably not an issue with ffsubsync or with ffmpeg-python, but with the version of the future package you have installed. You should see an improvement after running

pip install --upgrade future

smacke avatar Dec 31 '22 02:12 smacke

@rlue this is probably not an issue with ffsubsync or with ffmpeg-python, but with the version of the future package you have installed. You should see an improvement after running

pip install --upgrade future

That's true but this project specifies the exact version of future you should install (future==0.17.1) see requirements.txt.

frenzymadness avatar Jul 20 '23 06:07 frenzymadness