AttributeError:模块“ vlc”没有属性“ Instance”

时间:2019-04-15 15:01:42

标签: python vlc

我正在尝试使用vlc录制直播。 我猜,问题是我的应用无法检测到已安装的vlc。我使用

安装了它
Dim piTMP AS PivotItem, pfTMP AS PivotField
Set pfTMP = sht.PivotTables("PivotTable1").PivotFields("WEEK")
'Once through
For Each piTMP In pfTMP.PivotItems
    piTMP.Name = piTMP.SourceName & "_AndSomeTextThatYouNeverUse"
Next piTMP
'Twice through
For Each piTMP In pfTMP.PivotItems
    piTMP.Name = piTMP.SourceName
Next piTMP

我试图将.py文件放入vlc文件夹,但随后又遇到另一个问题

pip install python-vlc
[00212d24] main libvlc error: No modules were found, refusing to start. Check that you properly gave a module path with --plugin-path.
Traceback (most recent call last):
  File "asdads.py", line 25, in <module>
    grabar_audio(radio, datos)
  File "asdads.py", line 13, in grabar_audio
    player = instancia.media_player_new()
AttributeError: 'NoneType' object has no attribute 'media_player_new'

我该如何解决?

1 个答案:

答案 0 :(得分:0)

python-vlc是python与vlc程序(或包装器库)的绑定。这是通过python运行vlc程序的一种方式(python->绑定-> vlc)。因此,您需要执行以下步骤:

1)  copy vlc.py to where you run your application
2)  download vlc program and install it in your machine
3)  restart your machine and run notebook again

您已完成第1步,因此可以在以下链接中下载并安装vlc(64位):https://download.cnet.com/VLC-Media-Player-64-bit/3000-13632_4-75761094.html