Python bindings for VLC

人盡茶涼 提交于 2019-11-29 22:19:54

问题


I am on Windows, and I wish to use Python Bindings for VLC. I've already downloaded the module from https://github.com/geoffsalmon/vlc-python , and did as per the read me. But, still I'm stuck at importing the module. The error looks like this :

Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
  import vlc
  File "c:\python27\python-vlc-1.1.2\vlc.py", line 173, in <module>
  dll, plugin_path  = find_lib()
  File "c:\python27\python-vlc-1.1.2\vlc.py", line 150, in find_lib
  dll = ctypes.CDLL('libvlc.dll')
  File "C:\Python27\lib\ctypes\__init__.py", line 353, in __init__
  self._handle = _dlopen(self._name, mode)
  WindowsError: [Error 126] The specified module could not be found

Any Solution on where to place the module ? My main aim is to play MP3 audio files through vlc, which would be part of some other activity.


回答1:


I had same problem. It turns out for me if you have 64bit python, you need 64bit vlc player. If you have 32bit python, you need 32bit vlc player.

Hope that works for you too.




回答2:


I paired with 64bit I solved as follows. Of course

# first set the environment which is required from vlc.py
import os
os.environ['PYTHON_VLC_MODULE_PATH'] = """C:\Program Files\VideoLan"""
os.environ['PYTHON_VLC_LIB_PATH'] = """C:\Program Files\VideoLan\VLC\libvlc.dll"""
# now you can import vlc
import vlc


来源:https://stackoverflow.com/questions/35487490/python-bindings-for-vlc

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