python - vlc.Instance: AttributeError("模块 'vlc' 没有属性 'Instance'")
问题描述
我正在尝试使 VLC 播放器正确导入,以便连续播放一系列 VLC 媒体文件。但是,我似乎无法让 VLC 正确导入!我已经下载了 vlc.py 并将其添加到我的工作区。它看起来像这样;
import vlc
class PlayerWindow(Frame):
def __init__(self, parent):
super().__init__()
self.parent = parent
self.parent.attributes('-alpha', 0)
self.parent.attributes("-fullscreen", True)
self.parent.bind_all("<Key>", self.key)
# VLC player controls
self.Instance = vlc.Instance()
self.player = self.Instance.media_player_new()
self.player.toggle_fullscreen()
self.player.video_set_key_input(False)
self.parent.update()
我正在使用 Microsoft VS 2017
解决方案
尝试卸载 vlc (pip uninstall vlc) 并重新安装它的组合。与 python-vlc 相同。还要检查您的路径变量是否已设置(VS Code 和 VideoLAN\VLC )。它必须工作。
推荐阅读
- ruby - API request through array
- laravel - .env 邮件设置中的邮件(smtp)错误凭据仍然发送邮件
- python - How to iterate through every other document from a mongo db cursor
- angularjs - Angularjs 1.4 - 两种绑定方式 - 输入文本更改但范围没有?
- jquery - Django: how to access JsonResponse dictionary in jquery?
- java - Loading data from MongoDB in IMap in Hazelcast when using Client-Server Topology
- php - Not being able to export a Big Query table
- java - 当前使用 vertx mongoclient 按日期查询 mongodb 的方法
- python - Python将表单数据从CSV文件输入到本地HTML文件
- node.js - Hubot: How to specify the agent to be used by robot.http