I'm using Python-VLC to create a video player and PyInstaller to generate the executable file on my Windows 10 machine. Initially, it gave me the error:
Import Error Failed to load dynlib/dll 'libvlc.dll'. Most probably this dynlib/dll was not found when the application was frozen.
To solve this issue, I added the missing dlls in the binaries of the .spec file in the following manner:
a = Analysis(['video_player.py'],
pathex=['C:\\Users\\harsh\\Desktop\\demo\\Video'],
binaries=[("C:\\Program Files\\VideoLAN\\VLC\\libvlc.dll","."),("C:\\Program Files\\VideoLAN\\VLC\\libvlccore.dll",".")],
datas=[],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
After doing this, I'm no more getting the above error. However, now I'm getting the following error:
Exception in thread Thread-3:
Traceback (most recent call last):
File "threading.py", line 914, in _bootstrap_inner
File "threading.py", line 862, in run
File "video_player.py", line 100, in vlc_player
AttributeError: 'NoneType' object has no attribute 'media_player_new'
The code which leads to this error is:
i=vlc.Instance('--fullscreen')
p=i.media_player_new()
I've made sure that I've installed Python-VLC. Am I missing anything else here ? Any suggestions on how to deal with this issue ?