Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import Vlc module in python

Tags:

python

vlc

I am trying to create a media player using vlc and python but it throws an Error which is No module named vlc. how to fix this?

like image 774
Rajesh Rajendran Avatar asked Jul 08 '16 11:07

Rajesh Rajendran


People also ask

How do I import a module into Python using VLC?

In order to install the VLC module in Python, we will use the pip installer following the command shown below: Syntax: $ pip install python-vlc.

How do I run python in VLC?

Install the Python VLC bindings with pip in a virtual environment. Create a Python file and import the VLC bindings. Instantiate a player object to play a file. Play that file.

How play media file in Python?

MediaPlayer object is the basic object in vlc module for playing the video. We can create a MediaPlayer object with the help of MediaPlayer method. Media can be video or even audio that is supported by vlc, it can be set with the help of set_media method.

How do I install VLC packages?

Double-click on the icon of the package: an icon will appear on your Desktop, right beside your drives. Open it and drag the VLC application from the resulting window to the place where you want to install it (it should be /Applications).


1 Answers

Install

$ sudo pip install python-vlc

Then you can import the python module

import vlc
like image 187
Sayali Sonawane Avatar answered Nov 04 '22 17:11

Sayali Sonawane