Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[linux] Package imp seems to be required for ffmpeg-python but imp doesn't exist on 3.12 #132

Closed
GordonFreemanK opened this issue Nov 26, 2024 · 2 comments

Comments

@GordonFreemanK
Copy link

I am trying to run on my local machine (ubuntu 20.04)

I've run pip3.12 install --user -U -r requirements.txt

Requirement already satisfied: torf in /home/me/.local/lib/python3.12/site-packages (from -r requirements.txt (line 1)) (4.2.7)
Requirement already satisfied: guessit in /home/me/.local/lib/python3.12/site-packages (from -r requirements.txt (line 2)) (3.8.0)
Requirement already satisfied: ffmpeg-python in /home/me/.local/lib/python3.12/site-packages (from -r requirements.txt (line 3)) (0.2.0)
Requirement already satisfied: pymediainfo==6.0.1 in /home/me/.local/lib/python3.12/site-packages (from -r requirements.txt (line 4)) (6.0.1)
Requirement already satisfied: tmdbsimple in /home/me/.local/lib/python3.12/site-packages (from -r requirements.txt (line 5)) (2.9.1)
Requirement already satisfied: anitopy in /home/me/.local/lib/python3.12/site-packages (from -r requirements.txt (line 6)) (2.1.1)
Requirement already satisfied: cli-ui in /home/me/.local/lib/python3.12/site-packages (from -r requirements.txt (line 7)) (0.17.2)
Requirement already satisfied: qbittorrent-api in /home/me/.local/lib/python3.12/site-packages (from -r requirements.txt (line 8)) (2024.11.70)
Requirement already satisfied: deluge-client in /home/me/.local/lib/python3.12/site-packages (from -r requirements.txt (line 9)) (1.10.2)
Requirement already satisfied: pyrobase in /home/me/.local/lib/python3.12/site-packages (from -r requirements.txt (line 10)) (0.5.2)
Requirement already satisfied: requests in /home/me/.local/lib/python3.12/site-packages (from -r requirements.txt (line 11)) (2.32.3)
Requirement already satisfied: cinemagoer in /home/me/.local/lib/python3.12/site-packages (from -r requirements.txt (line 12)) (2023.5.1)
Requirement already satisfied: pyimgbox in /home/me/.local/lib/python3.12/site-packages (from -r requirements.txt (line 13)) (1.0.7)
Requirement already satisfied: nest_asyncio in /home/me/.local/lib/python3.12/site-packages (from -r requirements.txt (line 14)) (1.6.0)
Requirement already satisfied: bencode.py in /home/me/.local/lib/python3.12/site-packages (from -r requirements.txt (line 15)) (4.0.0)
Requirement already satisfied: unidecode in /home/me/.local/lib/python3.12/site-packages (from -r requirements.txt (line 16)) (1.3.8)
Requirement already satisfied: beautifulsoup4 in /home/me/.local/lib/python3.12/site-packages (from -r requirements.txt (line 17)) (4.12.3)
Requirement already satisfied: pyoxipng in /home/me/.local/lib/python3.12/site-packages (from -r requirements.txt (line 18)) (9.0.0)
Requirement already satisfied: rich in /home/me/.local/lib/python3.12/site-packages (from -r requirements.txt (line 19)) (13.9.4)
Requirement already satisfied: Jinja2 in /home/me/.local/lib/python3.12/site-packages (from -r requirements.txt (line 20)) (3.1.4)
Requirement already satisfied: pyotp in /home/me/.local/lib/python3.12/site-packages (from -r requirements.txt (line 21)) (2.9.0)
Requirement already satisfied: str2bool in /home/me/.local/lib/python3.12/site-packages (from -r requirements.txt (line 22)) (1.1)
Requirement already satisfied: click in /home/me/.local/lib/python3.12/site-packages (from -r requirements.txt (line 23)) (8.1.7)
Requirement already satisfied: aiohttp in /home/me/.local/lib/python3.12/site-packages (from -r requirements.txt (line 24)) (3.11.7)
Requirement already satisfied: Pillow in /home/me/.local/lib/python3.12/site-packages (from -r requirements.txt (line 25)) (11.0.0)
Requirement already satisfied: flatbencode==0.2.* in /home/me/.local/lib/python3.12/site-packages (from torf->-r requirements.txt (line 1)) (0.2.1)
Requirement already satisfied: rebulk>=3.2.0 in /home/me/.local/lib/python3.12/site-packages (from guessit->-r requirements.txt (line 2)) (3.2.0)
Requirement already satisfied: babelfish>=0.6.0 in /home/me/.local/lib/python3.12/site-packages (from guessit->-r requirements.txt (line 2)) (0.6.1)
Requirement already satisfied: python-dateutil in /usr/lib/python3/dist-packages (from guessit->-r requirements.txt (line 2)) (2.8.1)
Requirement already satisfied: future in /usr/lib/python3/dist-packages (from ffmpeg-python->-r requirements.txt (line 3)) (0.18.2)
Requirement already satisfied: colorama<0.5.0,>=0.4.1 in /usr/lib/python3/dist-packages (from cli-ui->-r requirements.txt (line 7)) (0.4.4)
Requirement already satisfied: tabulate<0.9.0,>=0.8.3 in /home/me/.local/lib/python3.12/site-packages (from cli-ui->-r requirements.txt (line 7)) (0.8.10)
Requirement already satisfied: packaging in /home/me/.local/lib/python3.12/site-packages (from qbittorrent-api->-r requirements.txt (line 8)) (24.1)
Requirement already satisfied: urllib3>=1.24.2 in /usr/lib/python3/dist-packages (from qbittorrent-api->-r requirements.txt (line 8)) (1.26.5)
Requirement already satisfied: six in /usr/lib/python3/dist-packages (from pyrobase->-r requirements.txt (line 10)) (1.16.0)
Requirement already satisfied: charset-normalizer<4,>=2 in /home/me/.local/lib/python3.12/site-packages (from requests->-r requirements.txt (line 11)) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3/dist-packages (from requests->-r requirements.txt (line 11)) (3.3)
Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3/dist-packages (from requests->-r requirements.txt (line 11)) (2020.6.20)
Requirement already satisfied: SQLAlchemy in /home/me/.local/lib/python3.12/site-packages (from cinemagoer->-r requirements.txt (line 12)) (2.0.36)
Requirement already satisfied: lxml in /home/me/.local/lib/python3.12/site-packages (from cinemagoer->-r requirements.txt (line 12)) (5.3.0)
Requirement already satisfied: httpx==0.* in /home/me/.local/lib/python3.12/site-packages (from pyimgbox->-r requirements.txt (line 13)) (0.27.2)
Requirement already satisfied: anyio in /home/me/.local/lib/python3.12/site-packages (from httpx==0.*->pyimgbox->-r requirements.txt (line 13)) (4.6.2.post1)
Requirement already satisfied: httpcore==1.* in /home/me/.local/lib/python3.12/site-packages (from httpx==0.*->pyimgbox->-r requirements.txt (line 13)) (1.0.7)
Requirement already satisfied: sniffio in /home/me/.local/lib/python3.12/site-packages (from httpx==0.*->pyimgbox->-r requirements.txt (line 13)) (1.3.1)
Requirement already satisfied: h11<0.15,>=0.13 in /home/me/.local/lib/python3.12/site-packages (from httpcore==1.*->httpx==0.*->pyimgbox->-r requirements.txt (line 13)) (0.14.0)
Requirement already satisfied: soupsieve>1.2 in /home/me/.local/lib/python3.12/site-packages (from beautifulsoup4->-r requirements.txt (line 17)) (2.6)
Requirement already satisfied: markdown-it-py>=2.2.0 in /home/me/.local/lib/python3.12/site-packages (from rich->-r requirements.txt (line 19)) (3.0.0)
Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /home/me/.local/lib/python3.12/site-packages (from rich->-r requirements.txt (line 19)) (2.18.0)
Requirement already satisfied: MarkupSafe>=2.0 in /usr/lib/python3/dist-packages (from Jinja2->-r requirements.txt (line 20)) (2.0.1)
Requirement already satisfied: aiohappyeyeballs>=2.3.0 in /home/me/.local/lib/python3.12/site-packages (from aiohttp->-r requirements.txt (line 24)) (2.4.0)
Requirement already satisfied: aiosignal>=1.1.2 in /home/me/.local/lib/python3.12/site-packages (from aiohttp->-r requirements.txt (line 24)) (1.3.1)
Requirement already satisfied: attrs>=17.3.0 in /home/me/.local/lib/python3.12/site-packages (from aiohttp->-r requirements.txt (line 24)) (24.2.0)
Requirement already satisfied: frozenlist>=1.1.1 in /home/me/.local/lib/python3.12/site-packages (from aiohttp->-r requirements.txt (line 24)) (1.4.1)
Requirement already satisfied: multidict<7.0,>=4.5 in /home/me/.local/lib/python3.12/site-packages (from aiohttp->-r requirements.txt (line 24)) (6.1.0)
Requirement already satisfied: propcache>=0.2.0 in /home/me/.local/lib/python3.12/site-packages (from aiohttp->-r requirements.txt (line 24)) (0.2.0)
Requirement already satisfied: yarl<2.0,>=1.17.0 in /home/me/.local/lib/python3.12/site-packages (from aiohttp->-r requirements.txt (line 24)) (1.18.0)
Requirement already satisfied: mdurl~=0.1 in /home/me/.local/lib/python3.12/site-packages (from markdown-it-py>=2.2.0->rich->-r requirements.txt (line 19)) (0.1.2)
Requirement already satisfied: typing-extensions>=4.6.0 in /home/me/.local/lib/python3.12/site-packages (from SQLAlchemy->cinemagoer->-r requirements.txt (line 12)) (4.12.2)
Requirement already satisfied: greenlet!=0.4.17 in /home/me/.local/lib/python3.12/site-packages (from SQLAlchemy->cinemagoer->-r requirements.txt (line 12)) (3.1.1)

But I cannot run it because imp cannot be installed

me@home:~/Upload-Assistant$ python3.12 upload.py
Traceback (most recent call last):
  File "/home/me/Upload-Assistant/src/prep.py", line 30, in <module>
    import ffmpeg
  File "/home/me/.local/lib/python3.12/site-packages/ffmpeg/__init__.py", line 2, in <module>
    from . import nodes
  File "/home/me/.local/lib/python3.12/site-packages/ffmpeg/nodes.py", line 3, in <module>
    from past.builtins import basestring
  File "/usr/lib/python3/dist-packages/past/builtins/__init__.py", line 54, in <module>
    from past.builtins.misc import (apply, chr, cmp, execfile, intern, oct,
  File "/usr/lib/python3/dist-packages/past/builtins/misc.py", line 45, in <module>
    from imp import reload
ModuleNotFoundError: No module named 'imp'
None
Missing Module Found. Please reinstall required dependancies.
pip3 install --user -U -r requirements.txt

If I try to install it manually:

me@home:~/Upload-Assistant$ pip3.12 install --user -U imp
ERROR: Could not find a version that satisfies the requirement imp (from versions: none)
ERROR: No matching distribution found for imp

I can install it on 3.10 but the app won't run on 3.10

The incompatibility of ffmpeg-python with python 3.12 seems to be confirmed by this PR and bug

But I might be missing something because the app clearly works in the docker image!

@Audionut
Copy link
Owner

Try:

pip install --upgrade future

Or patching the library:
nano /usr/lib/python3/dist-packages/past/builtins/misc.py

Replace:
from imp import reload
with
from importlib import reload

Or using a different ffmpeg:
pip uninstall ffmpeg-python
pip install imageio[ffmpeg]

Disclaimer: You get to keep whatever is left if it all burns down because you followed the above.

@GordonFreemanK
Copy link
Author

Perfect, solved with pip install --upgrade future

Thanks a lot for that, I don't know why I didn't pick that up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants