vlc.Instance: AttributeError(“module 'vlc' has no attribute 'Instance'”)

限于喜欢 提交于 2019-12-08 10:50:35

问题


I'm trying to make it so that the VLC player will import correctly so that it will play a series of VLC media files in succession. However, I cannot seem to get VLC to import properly! I've downloaded the vlc.py and added it to my workspace. It looks like this;

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()

Im using Microsoft VS 2017


回答1:


Try the combinations of uninstalling vlc ( pip uninstall vlc ) and reinstalling it . Same for python-vlc. Also check if your path variables are set( Both VS Code and VideoLAN\VLC ). It must work then.




回答2:


In my case it was solved by installing libvlc-dev on linux



来源:https://stackoverflow.com/questions/52405364/vlc-instance-attributeerrormodule-vlc-has-no-attribute-instance

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!