Python 2.7.14— importing vlc module on mac OS

Question:

in the last couple of days I was developing an APP on python IDLE.
I tried to import the vlc module, when I run it I get this error:
OSError: dlopen(libvlccore.dylib, 6): image not found

I installed the module with this command: pip install python-vlc.

I hope you can help me getting it work!
Thanks in advance!
Zaid Zaim

Asked By: Zaid Zaim

||

Answers:

python-vlc is just Python bindings for libVLC.

Without that library, it won’t do you any good, because all it does is try to load that library (a .dylib, .so, or .dll, depending on your platform) and call functions out of it.

There should be installation instructions at the wiki page linked above, but on a Mac, the easiest way is to just install the VLC player. I know that if you install it with Homebrew, you get the library, in a location that python-vlc can find. But I think even the binary installer from the front page of the main VideoLAN website will work as well.

If you’re using Homebrew, you’ll want to read the docs for when to search brew vs. brew cask vs. other taps,1 or search somewhere like Mac App Store for the current status. But at present, the appropriate command appears to be:

brew cask install vlc

1. Generally, anything that you’d expect to find as a double-clickable app in /Applications, as opposed to a Unix command-line tool or a support library, is going to be a cask, and therefore in the tap cask, which has special shortcuts to access it. But that’s a relatively new thing, and not every recipe has been converted yet.

Answered By: abarnert

brew install --cask vlc

Is the latest command, and it works for me!

Answered By: Themoonflow
Categories: questions Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.