在python中导入Vlc模块

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/38265773/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 20:35:12  来源:igfitidea点击:

Import Vlc module in python

pythonvlc

提问by Rajesh Rajendran

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?

我正在尝试使用 vlc 和 python 创建一个媒体播放器,但它抛出一个错误,即没有名为 vlc 的模块。如何解决这个问题?

采纳答案by SivamNatesan

I had a same issue. You should try sudo pip install python-vlc

我有同样的问题。你应该试试sudo pip install python-vlc

回答by Sayali Sonawane

Install

安装

$ sudo pip install python-vlc

Then you can import the python module

然后就可以导入python模块了

import vlc

回答by Saravana Kumar

There is also python-vlc

还有python-vlc

https://pypi.python.org/pypi/python-vlc/1.1.2

https://pypi.python.org/pypi/python-vlc/1.1.2

Download the .tar.gz file into your project and unzip it. Once unzipped, run:

将 .tar.gz 文件下载到您的项目中并解压。解压后,运行:

python setup.py install

This will install the python-vlc module for you and then try importing it in your python script.

这将为您安装 python-vlc 模块,然后尝试将其导入到您的 python 脚本中。

P.S Make sure you are inside the unzipped folder and you can see the setup.py file.

PS 确保你在解压后的文件夹中,你可以看到 setup.py 文件。

回答by fr1550n

The answer didn't work for me, using Mu 1.0.2 on a Raspberry Pi, this did however:

答案对我不起作用,在 Raspberry Pi 上使用 Mu 1.0.2,但是这样做了:

sudo pip3 install vlc

sudo pip3 install vlc