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

Can't install yt-dlp because of Python problem #207164

Closed
4 tasks done
Duarte475 opened this issue Feb 10, 2025 · 2 comments
Closed
4 tasks done

Can't install yt-dlp because of Python problem #207164

Duarte475 opened this issue Feb 10, 2025 · 2 comments
Labels
user configuration User configuration rather than a Homebrew issue

Comments

@Duarte475
Copy link

brew gist-logs <formula> link OR brew config AND brew doctor output

duarte@MacBook-Pro-de-Duarte ~ % brew gist-logs [email protected]
https://gist.github.com/Duarte475/b698d765a7afb06faed754ad2eccb195

duarte@MacBook-Pro-de-Duarte ~ % brew gist-logs yt-dlp 
Error: No logs.

duarte@MacBook-Pro-de-Duarte ~ % brew doctor
Your system is ready to brew.

Verification

  • My brew doctor output says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update and am still able to reproduce my issue.
  • I have resolved all warnings from brew doctor and that did not fix my problem.
  • I searched for recent similar issues at https://github.com/Homebrew/homebrew-core/issues?q=is%3Aissue and found no duplicates.

What were you trying to do (and why)?

I'm trying to install and run yt-dlp correctly

What happened (include all command output)?

duarte@MacBook-Pro-de-Duarte ~ % yt-dlp --version
Traceback (most recent call last):
  File "/opt/homebrew/bin/yt-dlp", line 5, in <module>
    from yt_dlp import main
  File "/opt/homebrew/Cellar/yt-dlp/2025.1.26/libexec/lib/python3.13/site-packages/yt_dlp/__init__.py", line 17, in <module>
    from .cookies import SUPPORTED_BROWSERS, SUPPORTED_KEYRINGS, CookieLoadError
  File "/opt/homebrew/Cellar/yt-dlp/2025.1.26/libexec/lib/python3.13/site-packages/yt_dlp/cookies.py", line 23, in <module>
    from .aes import (
    ...<3 lines>...
    )
  File "/opt/homebrew/Cellar/yt-dlp/2025.1.26/libexec/lib/python3.13/site-packages/yt_dlp/aes.py", line 5, in <module>
    from .dependencies import Cryptodome
  File "/opt/homebrew/Cellar/yt-dlp/2025.1.26/libexec/lib/python3.13/site-packages/yt_dlp/dependencies/__init__.py", line 65, in <module>
    import requests
  File "/opt/homebrew/Cellar/yt-dlp/2025.1.26/libexec/lib/python3.13/site-packages/requests/__init__.py", line 164, in <module>
    from .api import delete, get, head, options, patch, post, put, request
  File "/opt/homebrew/Cellar/yt-dlp/2025.1.26/libexec/lib/python3.13/site-packages/requests/api.py", line 11, in <module>
    from . import sessions
  File "/opt/homebrew/Cellar/yt-dlp/2025.1.26/libexec/lib/python3.13/site-packages/requests/sessions.py", line 15, in <module>
    from .adapters import HTTPAdapter
  File "/opt/homebrew/Cellar/yt-dlp/2025.1.26/libexec/lib/python3.13/site-packages/requests/adapters.py", line 81, in <module>
    _preloaded_ssl_context.load_verify_locations(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        extract_zipped_paths(DEFAULT_CA_BUNDLE_PATH)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
FileNotFoundError: [Errno 2] No such file or directory

What did you expect to happen?

I wanted yt-dlp to run correctly. It was supposed to output something like

duarte@MacBook-Pro-de-Duarte ~ % yt-dlp --version
2025.01.26

Step-by-step reproduction instructions (by running brew commands)

brew install yt-dlp
yt-dlp --version
@Duarte475 Duarte475 added the bug Reproducible Homebrew/homebrew-core bug label Feb 10, 2025
@cho-m cho-m added user configuration User configuration rather than a Homebrew issue and removed bug Reproducible Homebrew/homebrew-core bug labels Feb 10, 2025
@cho-m
Copy link
Member

cho-m commented Feb 10, 2025

Can't reproduce.

brew install yt-dlp
==> Downloading https://ghcr.io/v2/homebrew/core/yt-dlp/manifests/2025.1.26
...yt-dlp --version
2025.01.26

Most common reason for this type of failure is if you incorrectly deleted some etc files like accidentally running rm as mentioned in #177425

Particularly, never delete ca-certificates/openssl@* files unless you are confident it is unused, i.e. you no longer have formula installed.

e.g. to see a similar error:

rm /opt/homebrew/etc/ca-certificates/cert.pemyt-dlp --version 2>&1 | tail -5
        extract_zipped_paths(DEFAULT_CA_BUNDLE_PATH)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
FileNotFoundError: [Errno 2] No such file or directory

You are going to have to check your setup to see what is broken.

Without knowing anything else, at best can try brew reinstall ca-certificates certifi to try to restore any files you may have removed, e.g. from above state

brew reinstall ca-certificates certifi
==> Downloading https://ghcr.io/v2/homebrew/core/ca-certificates/manifests/2024-12-31
...yt-dlp --version
2025.01.26

@Duarte475
Copy link
Author

Thank you very much for your help
I tried brew reinstall ca-certificates certifi and it worked 🥳
For some reason I had in my head that it was some kind of Python related issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user configuration User configuration rather than a Homebrew issue
Projects
None yet
Development

No branches or pull requests

2 participants