问题
When I open vlc.py
with the python 2.7 interpreter it works, but when I open it with the python 3.4 interpreter it doesn't work. I get the below error.
I am pretty sure the issue is that the architecture is different for my python 3.4 (64bit in conda) and python 2.7 (32bit not in conda), so vlc.py
will only work with my python 2.7.
I understand that when the Python version and VLC is compatible, i.e. 32bit Python architecture, it works fine. But, I can't create this architecture in my conda because, my conda root is 64bits. Even if I create a new environment in conda and install Python 2 there, the root will still be 64bit. I tried this and it doesn't work.
For some reason VLC only seems to work when the platform architecture is 32bit. I just can't wrap my head around this issue.
Traceback (most recent call last):
File "C:\Users\Acer\Desktop\VLC Player\Main.py", line 28, in <module>
import vlc
File "C:\Users\Acer\Desktop\VLC Player\vlc.py", line 175, in <module>
dll, plugin_path = find_lib()
File "C:\Users\Acer\Desktop\VLC Player\vlc.py", line 152, in find_lib
dll = ctypes.CDLL('libvlc.dll')
File "C:\Users\Acer\Miniconda3\envs\updated\lib\ctypes\__init__.py", line 347, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
回答1:
Currently your 32bit VLC works with your 32bit python (which happens to be 2.7)
Uninstall your 32bit VLC, and download 64bit VLC. It'll work with 64bit python (which happens to be 3.4) now.
来源:https://stackoverflow.com/questions/48086279/vlc-and-python-architecture-comatibility-issue