Question: Hi I have the code below using pafy and vlc in order to play a youtube video however after running the code I get the

Hi I have the code below using pafy and vlc in order to play a youtube video however after running the code I get the error shown in the picture. How do I fix this problem so that it will show the youtube video. I'm using Pycharm

import pafy import vlc url = "https://www.youtube.com/watch?v=Y7I1nCcwJP0" video = pafy.new(url) best = video.getbest() playurl = best.url Instance = vlc.Instance() player = Instance.media_player_new() Media = Instance.media_new(playurl) Media.get_mrl() player.set_media(Media) player.play() Hi I have the code below using pafy and vlc in order

Traceback (most recent call last): File " import youtube_dl ModuleNotFoundError: No module named 'youtube_dl' line 48, in During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:/Users/ PycharmProjects/video/vid", line 1, in import pafy File "C:\Users PycharmProjects\video\venv\lib\site-packages\pafy\_init__.py", line 7, in from .pafy import new File "C:\Users PycharmProjects video venv\lib site-packages\pafy\pafy.py", line 51, in raise ImportError ImportError: pafy: youtube-dl not found; you can use the internal backend by setting the environmental variable PAFY_BACKEND to "internal". It is not enabled by default because it is not as well ma Traceback (most recent call last): File " import youtube_dl ModuleNotFoundError: No module named 'youtube_dl' line 48, in During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:/Users/ PycharmProjects/video/vid", line 1, in import pafy File "C:\Users PycharmProjects\video\venv\lib\site-packages\pafy\_init__.py", line 7, in from .pafy import new File "C:\Users PycharmProjects video venv\lib site-packages\pafy\pafy.py", line 51, in raise ImportError ImportError: pafy: youtube-dl not found; you can use the internal backend by setting the environmental variable PAFY_BACKEND to "internal". It is not enabled by default because it is not as well ma

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!