Python : ModuleNotFoundError: No module named 'youtube_dl'

Viewed 7332

I have to use youtube-dl for a program. When I try to execute my program with the command python downloader.py, my porgram start correctly, but when I try to execute directly my script with the command downloader.py, I get the following error : ModuleNotFoundError: No module named 'youtube_dl'

I already tried the following commands to install correctly youtube_dl :

pip install youtube-dl
pip3 install youtube-dl
pip install --upgrade youtube-dl

but it doesn't resolve my problem.

I think it's because I can't import a module with - with python3 so I have to import it with _ and windows don't recognize it. Thank's by advance for helping me

1 Answers

Not all packages can be installed with pip. try -

sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl

as their GitHub site suggests

Related