我正在尝试将 VLC 模块用于 python 脚本。我已经跑了
pip install python-vlc
C:\Users\Me>pip install python-vlc
Requirement already satisfied: python-vlc in c:\python34\lib\site-packages
当我运行“导入 vlc”时,出现此错误:
Python 3.4.4rc1 (v3.4.4rc1:04f3f725896c, Dec 6 2015, 17:06:10) [MSC v.1600 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import vlc
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python34\lib\vlc.py", line 181, in <module>
dll, plugin_path = find_lib()
File "C:\Python34\lib\vlc.py", line 159, in find_lib
dll = ctypes.CDLL(p)
File "C:\Python34\lib\ctypes\__init__.py", line 351, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application
>>>
过去几个小时我一直在试图解决这个问题,但我被难住了。在通过 SO 和 Google 搜索了一段时间后,我相信这与设置 PATH 变量有关?但是,我可能会离开。也许我安装错了,或者什么,我不知道......
1.卸载你的vlc 2.在本地磁盘上搜索“libvlc.dll”,并将其全部删除。 3.再次安装vlc(x64),注意不要安装在“program files”下, 然后就可以了。