Ubuntu 22.04: ImportError: libffi.so.7

See original GitHub issue

Checklist

  • I’m reporting a bug unrelated to a specific site
  • I’ve verified that I’m running yt-dlp version 2022.07.18 (update instructions) or later (specify commit)
  • I’ve checked that all provided URLs are playable in a browser with the same IP and same login details
  • I’ve checked that all URLs and arguments with special characters are properly quoted or escaped
  • I’ve searched the bugtracker for similar issues including closed ones. DO NOT post duplicates
  • I’ve read the guidelines for opening an issue

Provide a description that is worded well enough to be understood

yt-dlp https://www.example.com
Traceback (most recent call last):
  File "$USER/.local/bin/yt-dlp", line 5, in <module>
    from yt_dlp import main
  File "$USER/.local/lib/python3.10/site-packages/yt_dlp/__init__.py", line 14, in <module>
    from .cookies import SUPPORTED_BROWSERS, SUPPORTED_KEYRINGS
  File "$USER/.local/lib/python3.10/site-packages/yt_dlp/cookies.py", line 3, in <module>
    import ctypes
  File "/usr/local/lib/python3.10/ctypes/__init__.py", line 8, in <module>
    from _ctypes import Union, Structure, Array
ImportError: libffi.so.7: cannot open shared object file: No such file or directory

Provide verbose output that clearly demonstrates the problem

  • Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
  • Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

yt-dlp -vU https://www.example.uri -F
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/usr/local/bin/yt-dlp/__main__.py", line 14, in <module>
  File "/usr/local/bin/yt-dlp/yt_dlp/__init__.py", line 14, in <module>
  File "/usr/local/bin/yt-dlp/yt_dlp/cookies.py", line 3, in <module>
  File "/usr/local/lib/python3.10/ctypes/__init__.py", line 8, in <module>
    from _ctypes import Union, Structure, Array
ImportError: libffi.so.7: cannot open shared object file: No such file or directory

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
pukkandancommented, Aug 3, 2022

and a dependency isn’t correctly listed in the pipy package manager

I don’t mean a dependency of yt-dlp, but a dep of Python itself. I suggest you ask around in some Python/Ubuntu forums if you want to to figure out the exact root cause.

If you just want to get yt-dlp working, I have added a workaround. Wait for release or install master branch

0reactions
spirillencommented, Aug 3, 2022

I’ll just wait a minute then 😃 i’m all busy rebuilding mypdns.org

Read more comments on GitHub >

github_iconTop Results From Across the Web

libffi.so.7: cannot open shared object file - Ask Ubuntu
Ubuntu 20.04 came with a shared library called libffi.so.7 , from the package libffi7. This library has been referenced by one of your...
Read more >
Python 3.9.7: ImportError: libffi.so.7: cannot open shared ...
libffi is required by cffi, a bcrypt dependency. This suggests you've installed cffi in a manner where it's attempting to load a shared...
Read more >
Ubuntu 20.04 upgrade, Python missing libffi.so.6
Ubuntu 20.04 upgraded libffi6 to libffi7; Python is still looking for libffi6. What I did to fix it : Locate libffi.so.7 in your...
Read more >
libffi.so.7: cannot open shared object file: No such ... - Rob's Blog
[workaround] ImportError: libffi.so.7: cannot open shared object file: No such file or directory ... (you may notice a reference to pyenv in there ......
Read more >
ImportError libffi.so.7 cannot open shared object file No ... - ynrfin
This error happened after I try to run a Django project on Linux(Manjaro) after an sistem update. ImportError: libffi.so.7: cannot open ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found