简体   繁体   English

Python 2.7.14---在mac OS上导入vlc模块

[英]Python 2.7.14--- importing vlc module on mac OS

in the last couple of days I was developing an APP on python IDLE.在过去的几天里,我正在 python IDLE 上开发一个 APP。 I tried to import the vlc module, when I run it I get this error: OSError: dlopen(libvlccore.dylib, 6): image not found我尝试导入 vlc 模块,当我运行它时出现此错误: OSError: dlopen(libvlccore.dylib, 6): image not found

I installed the module with this command: pip install python-vlc.我使用以下命令安装了模块:pip install python-vlc。

I hope you can help me getting it work!我希望你能帮助我让它工作! Thanks in advance!提前致谢! Zaid Zaim扎伊德扎伊姆

python-vlc is just Python bindings for libVLC . python-vlc只是libVLC Python绑定。

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. 没有该库,它将对您没有任何好处,因为它所做的只是尝试加载该库( .dylib.so.dll ,具体取决于您的平台)并从中调用函数。

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. 上面链接的Wiki页面上应该有安装说明,但是在Mac上,最简单的方法是仅安装VLC播放器。 I know that if you install it with Homebrew , you get the library, in a location that python-vlc can find. 我知道,如果使用Homebrew进行安装,则会在python-vlc可以找到的位置获得该库。 But I think even the binary installer from the front page of the main VideoLAN website will work as well. 但是我认为,即使是VideoLAN主网站首页上的二进制安装程序也可以正常工作。

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. 如果您使用的是Homebrew,则需要阅读文档以了解何时搜索brewbrew cask其他水龙头1或在Mac App Store之类的位置搜索当前状态。 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. 1.通常,您希望在/Applications找到可双击应用程序的任何东西,而不是Unix命令行工具或支持库,都将成为一个容器,因此,在Tap cask ,具有特殊的快捷方式可以访问它。 But that's a relatively new thing, and not every recipe has been converted yet. 但这是一个相对较新的事物,并不是每个配方都已经转换。

brew install --cask vlc

Is the latest command, and it works for me!是最新的命令,它对我有用!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM