devine-dl/pywidevine

pip install lacks yaml dependency

Closed this issue · 3 comments

I tried it on Arch Linux with:

pipx install pywidevine

and on MacOS with:

pip install pywidevine

After installing it, I run pywidevine -h and this is the output:

Traceback (most recent call last):
  File "/opt/homebrew/bin/pywidevine", line 5, in <module>
    from pywidevine.main import main
  File "/opt/homebrew/lib/python3.11/site-packages/pywidevine/main.py", line 9, in <module>
    import yaml
ModuleNotFoundError: No module named 'yaml'

Not sure how this is the case, since PyYAML is a dependency, as seen here therefore it should be installed. The project name and identifier is PyYAML but it installs a module named yaml.

I cannot personally re-create this issue on my end. If you manually do pip install PyYAML does it solve the issue for you?

I created an empty python environment and did the installation. This is the result:

pywidevine.mp4

As you can see the PyYAML module is not installed. The recording is made on MacOS but it also happens to me on Arch Linux.

Python 3.11.7 (Linux)
Python 3.11.6 (MacOS)
pip 23.2.1 (Linux)
pip 23.3.2 (MacOS)

I see. If I look at the dist-info metadata file I do see: Requires-Dist: PyYAML (>=6.0.1,<7.0.0) ; extra == "serve" meaning it will only install if you do pip install pywidevine[serve]. Yet the dependency marker is not marked as optional, I'll remove it from the extras group anyway as that is still likely the cause.