无法将vlc模块导入Python,"不是有效的Win32应用程序"错误

时间:2017-04-28 23:14:06

标签: python vlc libvlc

我正在尝试将VLC模块用于python脚本。我已经运行了pip install python-vlc

C:\Users\Me>pip install python-vlc
Requirement already satisfied: python-vlc in c:\python34\lib\site-packages

当我运行' import 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 个答案:

答案 0 :(得分:1)

  1. 卸载vlc
  2. 搜索libvlc.dll&#39;在本地磁盘上,并将其全部删除。
  3. 再次安装vlc(x64),并注意不要将其安装在&#39;程序文件&#39;,
  4. 然后它会起作用。