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

No package metadata was found for yt-dlp #5941

Closed
9 tasks done
Len-PGH opened this issue Jan 3, 2023 · 23 comments
Closed
9 tasks done

No package metadata was found for yt-dlp #5941

Len-PGH opened this issue Jan 3, 2023 · 23 comments
Labels
external issue Issue with an external tool

Comments

@Len-PGH
Copy link

Len-PGH commented Jan 3, 2023

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

  • I understand that I will be blocked if I remove or skip any mandatory* field

Checklist

  • I'm reporting a bug unrelated to a specific site
  • I've verified that I'm running yt-dlp version 2023.01.02 (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

New Year 2023 Binary gives error from https://github.com/yt-dlp/yt-dlp/archive/master.zip

Installing using python3 -m pip install --no-cache-dir --force-reinstall https://github.com/yt-dlp/yt-dlp/archive/master.zip

Error

nginx:/# yt-dlp 
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/importlib_metadata/__init__.py", line 381, in from_name
    return next(cls.discover(name=name))
StopIteration
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/bin/yt-dlp", line 33, in <module>
    sys.exit(load_entry_point('yt-dlp==2023.1.2', 'console_scripts', 'yt-dlp')())
  File "/usr/bin/yt-dlp", line 22, in importlib_load_entry_point
    for entry_point in distribution(dist_name).entry_points
  File "/usr/local/lib/python3.7/dist-packages/importlib_metadata/__init__.py", line 805, in distribution
    return Distribution.from_name(distribution_name)
  File "/usr/local/lib/python3.7/dist-packages/importlib_metadata/__init__.py", line 383, in from_name
    raise PackageNotFoundError(name)
importlib_metadata.PackageNotFoundError: No package metadata was found for yt-dlp

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
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/importlib_metadata/__init__.py", line 381, in from_name
    return next(cls.discover(name=name))
StopIteration
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/bin/yt-dlp", line 33, in <module>
    sys.exit(load_entry_point('yt-dlp==2023.1.2', 'console_scripts', 'yt-dlp')())
  File "/usr/bin/yt-dlp", line 22, in importlib_load_entry_point
    for entry_point in distribution(dist_name).entry_points
  File "/usr/local/lib/python3.7/dist-packages/importlib_metadata/__init__.py", line 805, in distribution
    return Distribution.from_name(distribution_name)
  File "/usr/local/lib/python3.7/dist-packages/importlib_metadata/__init__.py", line 383, in from_name
    raise PackageNotFoundError(name)
importlib_metadata.PackageNotFoundError: No package metadata was found for yt-dlp
@Len-PGH Len-PGH added bug Bug that is not site-specific triage Untriaged issue labels Jan 3, 2023
@Grub4K
Copy link
Member

Grub4K commented Jan 3, 2023

Most likely a problem with the newly added pyproject.toml?

@pukkandan
Copy link
Member

hm.. it works for me

Windows

❯ py -3.7 -m pip install --no-cache-dir --force-reinstall https://github.com/yt-dlp/yt-dlp/archive/master.zip
Collecting https://github.com/yt-dlp/yt-dlp/archive/master.zip
  Downloading https://github.com/yt-dlp/yt-dlp/archive/master.zip
     / 2.9 MB 770 kB/s
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
    Preparing wheel metadata ... done
Collecting mutagen
  Downloading mutagen-1.46.0-py3-none-any.whl (193 kB)
     |████████████████████████████████| 193 kB 3.3 MB/s
Collecting brotli; platform_python_implementation == "CPython"
  Downloading Brotli-1.0.9-cp37-cp37m-win_amd64.whl (365 kB)
     |████████████████████████████████| 365 kB ...
Collecting pycryptodomex
  Downloading pycryptodomex-3.16.0-cp35-abi3-win_amd64.whl (1.7 MB)
     |████████████████████████████████| 1.7 MB 6.8 MB/s
Collecting certifi
  Downloading certifi-2022.12.7-py3-none-any.whl (155 kB)
     |████████████████████████████████| 155 kB 3.3 MB/s
Collecting websockets
  Downloading websockets-10.4-cp37-cp37m-win_amd64.whl (101 kB)
     |████████████████████████████████| 101 kB 6.4 MB/s
Building wheels for collected packages: yt-dlp
  Building wheel for yt-dlp (PEP 517) ... done
  Created wheel for yt-dlp: filename=yt_dlp-2023.1.2-py2.py3-none-any.whl size=2607627 sha256=90a8f9c34bda159dcf8435f903f8a3fd340040ed5a639c13f62b5a63fe9552ec
  Stored in directory: C:\Users\me\AppData\Local\Temp\pip-ephem-wheel-cache-asggy4dy\wheels\d3\38\ae\6fc4ccb71a41f109af1af8867122972e2aa4f95eb732924bbf
Successfully built yt-dlp
Installing collected packages: mutagen, brotli, pycryptodomex, certifi, websockets, yt-dlp
  WARNING: The scripts mid3cp.exe, mid3iconv.exe, mid3v2.exe, moggsplit.exe, mutagen-inspect.exe and mutagen-pony.exe are installed in 'D:\Programs\scoop\apps\python37\3.7.9\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script yt-dlp.exe is installed in 'D:\Programs\scoop\apps\python37\3.7.9\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed brotli-1.0.9 certifi-2022.12.7 mutagen-1.46.0 pycryptodomex-3.16.0 websockets-10.4 yt-dlp-2023.1.2
WARNING: You are using pip version 20.1.1; however, version 22.3.1 is available.
You should consider upgrading via the 'D:\Programs\scoop\apps\python37\3.7.9\python.exe -m pip install --upgrade pip' command.

❯ D:\Programs\scoop\apps\python37\3.7.9\Scripts\yt-dlp.exe  -vU
[debug] Command-line config: ['-vU']
[debug] User config: []
[debug] System config: []
[debug] Encodings: locale cp65001, fs utf-8, pref cp65001, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2023.01.02 [d83b0ad80]
[debug] Lazy loading extractors is disabled
[debug] Python 3.7.9 (CPython AMD64 64bit) - Windows-10-10.0.22000-SP0 (OpenSSL 1.1.1g  21 Apr 2020)
[debug] exe versions: ffmpeg n5.1.2-8-g5746987bad-20221204 (fdk,setts), ffprobe N-109332-g45ab5307a6-20221201, phantomjs 2.1.1
[debug] Optional libraries: Cryptodome-3.16.0, brotli-1.0.9, certifi-2022.12.07, mutagen-1.46.0, sqlite3-2.6.0, websockets-10.4
[debug] Proxy map: {}
[debug] Loaded 1755 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2023.01.02, Current version: 2023.01.02
yt-dlp is up to date (2023.01.02)

Linux

me@DESKTOP-KGSH6Q9 /m/d/P/S/y/yt-dlp (master)> python3 -m pip install --no-cache-dir --force-reinstall https://github.com/yt-dlp/yt-dlp/archive/master.zip
Defaulting to user installation because normal site-packages is not writeable
Collecting https://github.com/yt-dlp/yt-dlp/archive/master.zip
  Downloading https://github.com/yt-dlp/yt-dlp/archive/master.zip (2.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.9/2.9 MB 3.3 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Collecting pycryptodomex
  Downloading pycryptodomex-3.16.0-cp35-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (2.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.3/2.3 MB 3.7 MB/s eta 0:00:00
Collecting certifi
  Downloading certifi-2022.12.7-py3-none-any.whl (155 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 155.3/155.3 kB 5.3 MB/s eta 0:00:00
Collecting mutagen
  Downloading mutagen-1.46.0-py3-none-any.whl (193 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 193.6/193.6 kB 23.8 MB/s eta 0:00:00
Collecting websockets
  Downloading websockets-10.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (106 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 107.0/107.0 kB 32.7 MB/s eta 0:00:00
Collecting brotli
  Downloading Brotli-1.0.9-cp38-cp38-manylinux1_x86_64.whl (357 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 357.2/357.2 kB 12.6 MB/s eta 0:00:00
Building wheels for collected packages: yt-dlp
  Building wheel for yt-dlp (pyproject.toml) ... done
  Created wheel for yt-dlp: filename=yt_dlp-2023.1.2-py2.py3-none-any.whl size=2607424 sha256=b0bf3db7745cafced720daacefaa89ba3887d4192e16b859e655e686846a2f4c
  Stored in directory: /tmp/pip-ephem-wheel-cache-r9p1iwf_/wheels/d1/08/0a/697919c7bf10b2b413156eca37b513dafbbdde486ead606793
Successfully built yt-dlp
Installing collected packages: brotli, websockets, pycryptodomex, mutagen, certifi, yt-dlp
  Attempting uninstall: brotli
    Found existing installation: Brotli 1.0.9
    Uninstalling Brotli-1.0.9:
      Successfully uninstalled Brotli-1.0.9
  Attempting uninstall: websockets
    Found existing installation: websockets 10.4
    Uninstalling websockets-10.4:
      Successfully uninstalled websockets-10.4
  Attempting uninstall: pycryptodomex
    Found existing installation: pycryptodomex 3.16.0
    Uninstalling pycryptodomex-3.16.0:
      Successfully uninstalled pycryptodomex-3.16.0
  Attempting uninstall: mutagen
    Found existing installation: mutagen 1.46.0
    Uninstalling mutagen-1.46.0:
      Successfully uninstalled mutagen-1.46.0
  WARNING: The scripts mid3cp, mid3iconv, mid3v2, moggsplit, mutagen-inspect and mutagen-pony are installed in '/home/me/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  Attempting uninstall: certifi
    Found existing installation: certifi 2022.12.7
    Uninstalling certifi-2022.12.7:
      Successfully uninstalled certifi-2022.12.7
  Attempting uninstall: yt-dlp
    Found existing installation: yt-dlp 2023.1.2
    Uninstalling yt-dlp-2023.1.2:
      Successfully uninstalled yt-dlp-2023.1.2
  WARNING: The script yt-dlp is installed in '/home/me/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed brotli-1.0.9 certifi-2022.12.7 mutagen-1.46.0 pycryptodomex-3.16.0 websockets-10.4 yt-dlp-2023.1.2
me@DESKTOP-KGSH6Q9 /m/d/P/S/y/yt-dlp (master) [1]> /home/me/.local/bin/yt-dlp -vU --ignore-config
[debug] Command-line config: ['-vU', '--ignore-config']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2023.01.02 [d83b0ad80]
[debug] Lazy loading extractors is disabled
[debug] Python 3.8.10 (CPython x86_64 64bit) - Linux-4.4.0-22000-Microsoft-x86_64-with-glibc2.29 (OpenSSL 1.1.1f  31 Mar 2020, glibc 2.31)
[debug] exe versions: ffmpeg 4.2.7, ffprobe 4.2.7, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.16.0, brotli-1.0.9, certifi-2022.12.07, mutagen-1.46.0, pyxattr-0.6.1, secretstorage-2.3.1, sqlite3-2.6.0, websockets-10.4
[debug] Proxy map: {}
[debug] Loaded 1755 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2023.01.02, Current version: 2023.01.02
yt-dlp is up to date (2023.01.02)

Can anyone else reproduce? @Len-PGH Do you get the error only for master, or for release version as well? How about if you try installing older versions?

@pukkandan pukkandan reopened this Jan 4, 2023
@vegidio

This comment was marked as duplicate.

@Len-PGH
Copy link
Author

Len-PGH commented Jan 4, 2023

@pukkandan Windows install and execution is working for me but not on Debian Buster(10). On Linux the install seems to install but when you try to use yt-dlp https://youtu.be/aqz-KE-bpKQ I get the error about ModuleNotFoundError: No module named 'importlib_metadata' When I try with a version from last year there is no error. Works as intended.

Is there a file that needs to be updated to reflect the newyear yt-dlp==2023.1.2 ?

root@buster:/usr/src# yt-dlp https://youtu.be/aqz-KE-bpKQ
Traceback (most recent call last):
  File "/usr/bin/yt-dlp", line 10, in <module>
    from importlib.metadata import distribution
ModuleNotFoundError: No module named 'importlib.metadata'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/yt-dlp", line 13, in <module>
    from importlib_metadata import distribution
ModuleNotFoundError: No module named 'importlib_metadata'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/yt-dlp", line 15, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3191, in <module>
    @_call_aside
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3175, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3204, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 583, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'yt-dlp==2023.1.2' distribution was not found and is required by the application

Also get same error with yt-dlp -vU

yt-dlp -vU
Traceback (most recent call last):
  File "/usr/bin/yt-dlp", line 10, in <module>
    from importlib.metadata import distribution
ModuleNotFoundError: No module named 'importlib.metadata'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/yt-dlp", line 13, in <module>
    from importlib_metadata import distribution
ModuleNotFoundError: No module named 'importlib_metadata'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/yt-dlp", line 15, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3191, in <module>
    @_call_aside
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3175, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3204, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 583, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'yt-dlp==2023.1.2' distribution was not found and is required by the application

@pukkandan
Copy link
Member

pukkandan commented Jan 4, 2023

How about if you try installing older versions?

You can do so with pip install --force-reinstall "yt-dlp<2023"

@vegidio
Copy link

vegidio commented Jan 4, 2023

@pukkandan On Alpine linux, where I'm having this problem:

$ apk add yt-dlp --repository=https://dl-cdn.alpinelinux.org/alpine/v3.16/community

The line above installs version 2022.05.18 and everything works fine.

But if I install version 2023.01.02 (line below), it doesn't work. I get the same error that @Len-PGH reported.

$ apk add yt-dlp --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community

Installing with PIP is the only way to make version 2023.01.02 work for me.

@pukkandan
Copy link
Member

pukkandan commented Jan 4, 2023

@vegidio Unless you can reproduce the issue with any of the official binaries/PiP, you need to report this to whoever is maintaining the alpine package

@Len-PGH
Copy link
Author

Len-PGH commented Jan 4, 2023

root@buster:/tmp# python3 -m pip install --no-cache-dir --force-reinstall "yt-dlp<2023"

Collecting yt-dlp<2023
  Downloading https://files.pythonhosted.org/packages/b6/7a/4f1067904adad79b5f3ba8c81f879975b56515764cb42e241cf3528cb017/yt_dlp-2022.11.11-py2.py3-none-any.whl (2.8MB)
    100% |████████████████████████████████| 2.8MB 12.5MB/s
Collecting mutagen (from yt-dlp<2023)
  Downloading https://files.pythonhosted.org/packages/03/ee/114d7016d2e34f341e212fefb5e7bd87785077ebcfff0ad23a497c70eea1/mutagen-1.46.0-py3-none-any.whl (193kB)
    100% |████████████████████████████████| 194kB 19.9MB/s
Collecting websockets (from yt-dlp<2023)
  Downloading https://files.pythonhosted.org/packages/5a/87/dea889793d2d0958be254fc86dac528d97de9354d16fcdbcbad259750014/websockets-10.4-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (106kB)
    100% |████████████████████████████████| 112kB 10.2MB/s
Collecting pycryptodomex (from yt-dlp<2023)
  Downloading https://files.pythonhosted.org/packages/76/dd/7276f37251f84931bd97bb42fe10455cad782dcb9a38b9820f65d2a098e8/pycryptodomex-3.16.0-cp35-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (2.3MB)
    100% |████████████████████████████████| 2.3MB 23.1MB/s
Collecting brotli; platform_python_implementation == "CPython" (from yt-dlp<2023)
  Downloading https://files.pythonhosted.org/packages/15/ea/5bd575511b37bbd1c794606a0a621e6feff8e96b7dd007a86a5d218b2d94/Brotli-1.0.9-cp37-cp37m-manylinux1_x86_64.whl (357kB)
    100% |████████████████████████████████| 358kB 21.5MB/s
Collecting certifi (from yt-dlp<2023)
  Downloading https://files.pythonhosted.org/packages/71/4c/3db2b8021bd6f2f0ceb0e088d6b2d49147671f25832fb17970e9b583d742/certifi-2022.12.7-py3-none-any.whl (155kB)
    100% |████████████████████████████████| 163kB 8.4MB/s
Installing collected packages: mutagen, websockets, pycryptodomex, brotli, certifi, yt-dlp
  Found existing installation: mutagen 1.46.0
    Uninstalling mutagen-1.46.0:
      Successfully uninstalled mutagen-1.46.0
  Found existing installation: websockets 10.4
    Uninstalling websockets-10.4:
      Successfully uninstalled websockets-10.4
  Found existing installation: pycryptodomex 3.16.0
    Uninstalling pycryptodomex-3.16.0:
      Successfully uninstalled pycryptodomex-3.16.0
  Found existing installation: Brotli 1.0.9
    Uninstalling Brotli-1.0.9:
      Successfully uninstalled Brotli-1.0.9
  Found existing installation: certifi 2022.12.7
    Uninstalling certifi-2022.12.7:
      Successfully uninstalled certifi-2022.12.7
  Found existing installation: yt-dlp 2022.11.11
    Uninstalling yt-dlp-2022.11.11:
      Successfully uninstalled yt-dlp-2022.11.11
Successfully installed brotli-1.0.9 certifi-2022.12.7 mutagen-1.46.0 pycryptodomex-3.16.0 websockets-10.4 yt-dlp-2022.11.11

root@buster:/tmp# yt-dlp -vU

Traceback (most recent call last):
  File "/usr/bin/yt-dlp", line 10, in <module>
    from importlib.metadata import distribution
ModuleNotFoundError: No module named 'importlib.metadata'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/yt-dlp", line 13, in <module>
    from importlib_metadata import distribution
ModuleNotFoundError: No module named 'importlib_metadata'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 583, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 791, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (yt-dlp 2022.11.11 (/usr/local/lib/python3.7/dist-packages), Requirement.parse('yt-dlp==2023.1.2'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/yt-dlp", line 15, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3191, in <module>
    @_call_aside
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3175, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3204, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 585, in _build_master
    return cls._build_from_requirements(__requires__)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 598, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'yt-dlp==2023.1.2' distribution was not found and is required by the application

@pukkandan
Copy link
Member

pkg_resources.DistributionNotFound: The 'yt-dlp==2023.1.2' distribution was not found and is required by the application

Your binary is looking for the wrong version. Perhaps remnant from an older install? Since older version also gives error, it's likely not issue with yt-dlp

@Len-PGH
Copy link
Author

Len-PGH commented Jan 4, 2023

Got it working on Debian Buster with python3 -m pip install --no-cache-dir --force-reinstall "yt-dlp>2023" Thank you for you help.

@Len-PGH Len-PGH closed this as completed Jan 4, 2023
@pukkandan
Copy link
Member

huh, weird. I am a bit concerned that the pyproject.toml could be the cause of the original breakage. Could you uninstall all yt-dlp versions you currently have, and then install master branch like in OP? Just so we can confirm it's working or not.

@Len-PGH
Copy link
Author

Len-PGH commented Jan 4, 2023

Fresh install on Debian 10

Doesn't work

pip3 install --no-cache-dir --force-reinstall https://github.com/yt-dlp/yt-dlp/archive/master.zip

# pip3 install --no-cache-dir --force-reinstall https://github.com/yt-dlp/yt-dlp/archive/master.zip
Collecting https://github.com/yt-dlp/yt-dlp/archive/master.zip
  Downloading https://github.com/yt-dlp/yt-dlp/archive/master.zip (2.9MB)
    100% |████████████████████████████████| 2.9MB 9.5MB/s
  Installing build dependencies ... done
Collecting mutagen (from yt-dlp==2023.1.2)
  Downloading https://files.pythonhosted.org/packages/03/ee/114d7016d2e34f341e212fefb5e7bd87785077ebcfff0ad23a497c70eea1/mutagen-1.46.0-py3-none-any.whl (193kB)
    100% |████████████████████████████████| 194kB 6.9MB/s
Collecting pycryptodomex (from yt-dlp==2023.1.2)
  Downloading https://files.pythonhosted.org/packages/76/dd/7276f37251f84931bd97bb42fe10455cad782dcb9a38b9820f65d2a098e8/pycryptodomex-3.16.0-cp35-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (2.3MB)
    100% |████████████████████████████████| 2.3MB 7.4MB/s
Collecting websockets (from yt-dlp==2023.1.2)
  Downloading https://files.pythonhosted.org/packages/5a/87/dea889793d2d0958be254fc86dac528d97de9354d16fcdbcbad259750014/websockets-10.4-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (106kB)
    100% |████████████████████████████████| 112kB 8.5MB/s
Collecting certifi (from yt-dlp==2023.1.2)
  Downloading https://files.pythonhosted.org/packages/71/4c/3db2b8021bd6f2f0ceb0e088d6b2d49147671f25832fb17970e9b583d742/certifi-2022.12.7-py3-none-any.whl (155kB)
    100% |████████████████████████████████| 163kB 8.1MB/s
Collecting brotli (from yt-dlp==2023.1.2)
  Downloading https://files.pythonhosted.org/packages/15/ea/5bd575511b37bbd1c794606a0a621e6feff8e96b7dd007a86a5d218b2d94/Brotli-1.0.9-cp37-cp37m-manylinux1_x86_64.whl (357kB)
    100% |████████████████████████████████| 358kB 8.0MB/s
Installing collected packages: mutagen, pycryptodomex, websockets, certifi, brotli, yt-dlp
  Running setup.py install for yt-dlp ... done
Successfully installed brotli-1.0.9 certifi-2022.12.7 mutagen-1.46.0 pycryptodomex-3.16.0 websockets-10.4 yt-dlp

/# yt-dlp -vU


Traceback (most recent call last):
  File "/usr/bin/yt-dlp", line 10, in <module>
    from importlib.metadata import distribution
ModuleNotFoundError: No module named 'importlib.metadata'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/yt-dlp", line 13, in <module>
    from importlib_metadata import distribution
ModuleNotFoundError: No module named 'importlib_metadata'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/yt-dlp", line 15, in <module>
    from pkg_resources import load_entry_point
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3191, in <module>
    @_call_aside
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3175, in _call_aside
    f(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 3204, in _initialize_master_working_set
    working_set = WorkingSet._build_master()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 583, in _build_master
    ws.require(__requires__)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 900, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 786, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'yt-dlp==2023.1.2' distribution was not found and is required by the application

Does Work

python3 -m pip install --no-cache-dir --force-reinstall "yt-dlp>2023"

Collecting yt-dlp>2023
  Downloading https://files.pythonhosted.org/packages/4f/82/2cf81d524309261c7d27ed15498eb9413d4d44100f270929de1784ec5db4/yt_dlp-2023.1.2-py2.py3-none-any.whl (2.8MB)
    100% |████████████████████████████████| 2.8MB 7.8MB/s
Collecting brotli; platform_python_implementation == "CPython" (from yt-dlp>2023)
  Downloading https://files.pythonhosted.org/packages/15/ea/5bd575511b37bbd1c794606a0a621e6feff8e96b7dd007a86a5d218b2d94/Brotli-1.0.9-cp37-cp37m-manylinux1_x86_64.whl (357kB)
    100% |████████████████████████████████| 358kB 8.3MB/s
Collecting websockets (from yt-dlp>2023)
  Downloading https://files.pythonhosted.org/packages/5a/87/dea889793d2d0958be254fc86dac528d97de9354d16fcdbcbad259750014/websockets-10.4-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (106kB)
    100% |████████████████████████████████| 112kB 8.4MB/s
Collecting pycryptodomex (from yt-dlp>2023)
  Downloading https://files.pythonhosted.org/packages/76/dd/7276f37251f84931bd97bb42fe10455cad782dcb9a38b9820f65d2a098e8/pycryptodomex-3.16.0-cp35-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (2.3MB)
    100% |████████████████████████████████| 2.3MB 7.9MB/s
Collecting certifi (from yt-dlp>2023)
  Downloading https://files.pythonhosted.org/packages/71/4c/3db2b8021bd6f2f0ceb0e088d6b2d49147671f25832fb17970e9b583d742/certifi-2022.12.7-py3-none-any.whl (155kB)
    100% |████████████████████████████████| 163kB 5.5MB/s
Collecting mutagen (from yt-dlp>2023)
  Downloading https://files.pythonhosted.org/packages/03/ee/114d7016d2e34f341e212fefb5e7bd87785077ebcfff0ad23a497c70eea1/mutagen-1.46.0-py3-none-any.whl (193kB)
    100% |████████████████████████████████| 194kB 6.5MB/s
Installing collected packages: brotli, websockets, pycryptodomex, certifi, mutagen, yt-dlp
  Found existing installation: Brotli 1.0.9
    Uninstalling Brotli-1.0.9:
      Successfully uninstalled Brotli-1.0.9
  Found existing installation: websockets 10.4
    Uninstalling websockets-10.4:
      Successfully uninstalled websockets-10.4
  Found existing installation: pycryptodomex 3.16.0
    Uninstalling pycryptodomex-3.16.0:
      Successfully uninstalled pycryptodomex-3.16.0
  Found existing installation: certifi 2022.12.7
    Uninstalling certifi-2022.12.7:
      Successfully uninstalled certifi-2022.12.7
  Found existing installation: mutagen 1.46.0
    Uninstalling mutagen-1.46.0:
      Successfully uninstalled mutagen-1.46.0
Successfully installed brotli-1.0.9 certifi-2022.12.7 mutagen-1.46.0 pycryptodomex-3.16.0 websockets-10.4 yt-dlp-2023.1.2

/# yt-dlp -vU

[debug] Command-line config: ['-vU']
[debug] User config: []
[debug] System config: []
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2023.01.02 [d83b0ad] (pip)
[debug] Python 3.7.3 (CPython x86_64 64bit) - Linux-5.4.72-microsoft-standard-WSL2-x86_64-with-debian-10.13 (OpenSSL 1.1.1n  15 Mar 2022, glibc 2.28)
[debug] exe versions: none
[debug] Optional libraries: Cryptodome-3.16.0, brotli-1.0.9, certifi-2022.12.07, mutagen-1.46.0, secretstorage-2.3.1, sqlite3-2.6.0, websockets-10.4
[debug] Proxy map: {}
[debug] Loaded 1754 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2023.01.02, Current version: 2023.01.02
yt-dlp is up to date (2023.01.02)

@pukkandan
Copy link
Member

Did you also have yt-dlp installed using a package manager?

@bashonly
Copy link
Member

bashonly commented Jan 5, 2023

@Len-PGH can you install the broken master branch again and show the output of cat /usr/bin/yt-dlp ?

@Len-PGH
Copy link
Author

Len-PGH commented Jan 5, 2023

Keep in mind that something with "yt-dlp>2023" makes things work correctly. I was able to reproduce in a docker container with Debian10

output of cat /usr/bin/yt-dlp and python3 verson.

cat /usr/bin/yt-dlp

#!/usr/bin/python3
# EASY-INSTALL-ENTRY-SCRIPT: 'yt-dlp==2023.1.2','console_scripts','yt-dlp'
import re
import sys

# for compatibility with easy_install; see #2198
__requires__ = 'yt-dlp==2023.1.2'

try:
    from importlib.metadata import distribution
except ImportError:
    try:
        from importlib_metadata import distribution
    except ImportError:
        from pkg_resources import load_entry_point


def importlib_load_entry_point(spec, group, name):
    dist_name, _, _ = spec.partition('==')
    matches = (
        entry_point
        for entry_point in distribution(dist_name).entry_points
        if entry_point.group == group and entry_point.name == name
    )
    return next(matches).load()


globals().setdefault('load_entry_point', importlib_load_entry_point)


if __name__ == '__main__':
    sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
    sys.exit(load_entry_point('yt-dlp==2023.1.2', 'console_scripts', 'yt-dlp')())

python3 -v

import _frozen_importlib # frozen
import _imp # builtin
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import '_warnings' # <class '_frozen_importlib.BuiltinImporter'>
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
# installing zipimport hook
import 'zipimport' # <class '_frozen_importlib.BuiltinImporter'>
# installed zipimport hook
import '_frozen_importlib_external' # <class '_frozen_importlib.FrozenImporter'>
import '_io' # <class '_frozen_importlib.BuiltinImporter'>
import 'marshal' # <class '_frozen_importlib.BuiltinImporter'>
import 'posix' # <class '_frozen_importlib.BuiltinImporter'>
import _thread # previously loaded ('_thread')
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import _weakref # previously loaded ('_weakref')
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
# /usr/lib/python3.7/encodings/__pycache__/__init__.cpython-37.pyc matches /usr/lib/python3.7/encodings/__init__.py
# code object from '/usr/lib/python3.7/encodings/__pycache__/__init__.cpython-37.pyc'
# /usr/lib/python3.7/__pycache__/codecs.cpython-37.pyc matches /usr/lib/python3.7/codecs.py
# code object from '/usr/lib/python3.7/__pycache__/codecs.cpython-37.pyc'
import '_codecs' # <class '_frozen_importlib.BuiltinImporter'>
import 'codecs' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4bd224fc18>
# /usr/lib/python3.7/encodings/__pycache__/aliases.cpython-37.pyc matches /usr/lib/python3.7/encodings/aliases.py
# code object from '/usr/lib/python3.7/encodings/__pycache__/aliases.cpython-37.pyc'
import 'encodings.aliases' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4bd2264630>
import 'encodings' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4bd224f6a0>
# /usr/lib/python3.7/encodings/__pycache__/utf_8.cpython-37.pyc matches /usr/lib/python3.7/encodings/utf_8.py
# code object from '/usr/lib/python3.7/encodings/__pycache__/utf_8.cpython-37.pyc'
import 'encodings.utf_8' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4bd2273358>
import '_signal' # <class '_frozen_importlib.BuiltinImporter'>
# /usr/lib/python3.7/encodings/__pycache__/latin_1.cpython-37.pyc matches /usr/lib/python3.7/encodings/latin_1.py
# code object from '/usr/lib/python3.7/encodings/__pycache__/latin_1.cpython-37.pyc'
import 'encodings.latin_1' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4bd2273e10>
# /usr/lib/python3.7/__pycache__/io.cpython-37.pyc matches /usr/lib/python3.7/io.py
# code object from '/usr/lib/python3.7/__pycache__/io.cpython-37.pyc'
# /usr/lib/python3.7/__pycache__/abc.cpython-37.pyc matches /usr/lib/python3.7/abc.py
# code object from '/usr/lib/python3.7/__pycache__/abc.cpython-37.pyc'
import '_abc' # <class '_frozen_importlib.BuiltinImporter'>
import 'abc' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4bd2279438>
import 'io' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4bd2279080>
# /usr/lib/python3.7/__pycache__/site.cpython-37.pyc matches /usr/lib/python3.7/site.py
# code object from '/usr/lib/python3.7/__pycache__/site.cpython-37.pyc'
# /usr/lib/python3.7/__pycache__/os.cpython-37.pyc matches /usr/lib/python3.7/os.py
# code object from '/usr/lib/python3.7/__pycache__/os.cpython-37.pyc'
# /usr/lib/python3.7/__pycache__/stat.cpython-37.pyc matches /usr/lib/python3.7/stat.py
# code object from '/usr/lib/python3.7/__pycache__/stat.cpython-37.pyc'
import '_stat' # <class '_frozen_importlib.BuiltinImporter'>
import 'stat' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4bd2211668>
# /usr/lib/python3.7/__pycache__/posixpath.cpython-37.pyc matches /usr/lib/python3.7/posixpath.py
# code object from '/usr/lib/python3.7/__pycache__/posixpath.cpython-37.pyc'
# /usr/lib/python3.7/__pycache__/genericpath.cpython-37.pyc matches /usr/lib/python3.7/genericpath.py
# code object from '/usr/lib/python3.7/__pycache__/genericpath.cpython-37.pyc'
import 'genericpath' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4bd221f160>
import 'posixpath' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4bd2211da0>
# /usr/lib/python3.7/__pycache__/_collections_abc.cpython-37.pyc matches /usr/lib/python3.7/_collections_abc.py
# code object from '/usr/lib/python3.7/__pycache__/_collections_abc.cpython-37.pyc'
import '_collections_abc' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4bd221f7b8>
import 'os' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4bd2285320>
# /usr/lib/python3.7/__pycache__/_sitebuiltins.cpython-37.pyc matches /usr/lib/python3.7/_sitebuiltins.py
# code object from '/usr/lib/python3.7/__pycache__/_sitebuiltins.cpython-37.pyc'
import '_sitebuiltins' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4bd22856d8>
# /usr/lib/python3.7/__pycache__/sitecustomize.cpython-37.pyc matches /usr/lib/python3.7/sitecustomize.py
# code object from '/usr/lib/python3.7/__pycache__/sitecustomize.cpython-37.pyc'
import 'sitecustomize' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4bd223b940>
import 'site' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4bd2279ef0>
Python 3.7.3 (default, Oct 31 2022, 14:04:00) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
# extension module 'readline' loaded from '/usr/lib/python3.7/lib-dynload/readline.cpython-37m-x86_64-linux-gnu.so'
# extension module 'readline' executed from '/usr/lib/python3.7/lib-dynload/readline.cpython-37m-x86_64-linux-gnu.so'
import 'readline' # <_frozen_importlib_external.ExtensionFileLoader object at 0x7f4bd21b6080>
import 'atexit' # <class '_frozen_importlib.BuiltinImporter'>
# /usr/lib/python3.7/__pycache__/rlcompleter.cpython-37.pyc matches /usr/lib/python3.7/rlcompleter.py
# code object from '/usr/lib/python3.7/__pycache__/rlcompleter.cpython-37.pyc'
import 'rlcompleter' # <_frozen_importlib_external.SourceFileLoader object at 0x7f4bd21b6198>

@pukkandan
Copy link
Member

Keep in mind that something with "yt-dlp>2023" makes things work correctly.

This installs the latest release, and not master branch

@selfisekai
Copy link
Contributor

@vegidio this is due to python version upgrade between v3.16 and v3.17. update your system and use the package from v3.17 (2022.11.11), or switch to Alpine edge.

@vegidio
Copy link

vegidio commented Jan 5, 2023

@selfisekai Thanks, that was the problem! ❤️

@bashonly
Copy link
Member

bashonly commented Jan 6, 2023

@Len-PGH
what happens if you run

python3 -m pip install --upgrade pip setuptools wheel

then

python3 -m pip install --force-reinstall https://github.com/yt-dlp/yt-dlp/archive/master.zip

and then run yt-dlp

@Len-PGH
Copy link
Author

Len-PGH commented Jan 6, 2023

@bashonly that works

/# yt-dlp -vU

[debug] Command-line config: ['-vU']
[debug] User config: []
[debug] System config: []
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version 2023.01.02 [d83b0ad80]
[debug] Lazy loading extractors is disabled
[debug] Python 3.7.3 (CPython x86_64 64bit) - Linux-5.4.72-microsoft-standard-WSL2-x86_64-with-debian-10.13 (OpenSSL 1.1.1n  15 Mar 2022, glibc 2.28)
[debug] exe versions: none
[debug] Optional libraries: Cryptodome-3.16.0, brotli-1.0.9, certifi-2022.12.07, mutagen-1.46.0, secretstorage-2.3.1, sqlite3-2.6.0, websockets-10.4
[debug] Proxy map: {}
[debug] Loaded 1757 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: 2023.01.02, Current version: 2023.01.02
yt-dlp is up to date (2023.01.02)

@bashonly
Copy link
Member

bashonly commented Jan 6, 2023

@Len-PGH Nice! Thanks for helping to investigate this issue

@bashonly bashonly added external issue Issue with an external tool and removed bug Bug that is not site-specific triage Untriaged issue labels Jan 6, 2023
@pukkandan

This comment was marked as outdated.

@pukkandan
Copy link
Member

pukkandan commented Jan 6, 2023

For future reference

pypa/distutils#17
pypa/setuptools#2232

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

No branches or pull requests

6 participants