Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

VLC libraries not found on Ubuntu 20.04 when VLC is installed with snap #156

Closed
olivierfriard opened this issue Nov 15, 2020 · 2 comments
Closed

Comments

@olivierfriard
Copy link

Hi,

thank you for your work on Python VLC binding.

I develop a program based on python-vlc and noticed that on Ubuntu 20.04 the last version of vlc.py (3.0.11115) does not find the VLC libraries when VLC is installed with the snap method (VLC media player 3.0.11 Vetinari revision 3.0.11-0-gdc0c5ced72)

python3 vlc.py
dll:<CDLL 'None', handle 7fe7ea63b190 at 0x7fe7e98de6d0> plugin_path: None
Traceback (most recent call last):
File "vlc.py", line 8624, in
instance = Instance(["--sub-source=marq"] + sys.argv[1:])
File "vlc.py", line 1885, in new
return libvlc_new(len(args), args)
File "vlc.py", line 4684, in libvlc_new
_Cfunction('libvlc_new', ((1,), (1,),), class_result(Instance),
File "vlc.py", line 294, in _Cfunction
raise NameError('no function %r' % (name,))
NameError: no function 'libvlc_new'

I removed VLC and reinstalled it with the apt method (VLC media player 3.0.9.2-1)

The libraries are recognized but the Instance class returns a None value:

Python 3.8.5 (default, Jul 28 2020, 12:59:40)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import vlc
dll:<CDLL 'libvlc.so.5', handle 1a23090 at 0x7fa9a76ef0d0> plugin_path: None
instance = vlc.Instance([])
print(instance)
None

The last vlc.py works well on Ubuntu 18.04.5 LTS with vlc install with apt (VLC 3.0.8)

Thank you for checking this, I am available to do some tests

Best,

Olivier

@oaubert
Copy link
Owner

oaubert commented Nov 15, 2020

Thanks for reporting this. It seems there are 2 issues here: the first one concerning snaps and the other one concerning a standard install that does not work.
For the first one, I would guess (as mentioned in https://stackoverflow.com/a/52061853 ) that snaps are not meant to be reusable components, just self-contained and isolated runnable versions of a given application. There should be ways to hack some support or find some snap-specific API or mechanism (see the find_lib function at the beginning of vlc.py) to try to automatically handle this situation, but I lack knowledge about snap to know whether this is a desirable approach. Feel free to investigate and propose solutions.
For the second one, it would be better handled in another issue (given the title of this one). Could you report it as a new issue, with additional information like the messages displayed when trying to instanciate with the verbose flag:

import vlc
instance = vlc.Instance(["--verbose", "2"])

@olivierfriard
Copy link
Author

Hi,
Thank you for the explanation on snap. I put a warning on the web site (I knew for snap) when VLC begins to be pre-installed with snap on Ubuntu.
I started a new issue for python-vlc on Ubuntu 20.04: #157

Thank you
Olivier

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants