Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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() image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions