python vlc安装问题 [英] Python vlc install problems
问题描述
好吧,所以我正在尝试使用 pip 安装 vlc,它告诉我成功安装了 python-vlc 好的,这就是我想要的,但是当我去运行程序时,我试图在女巫中使用 vlc 就在这里
alright so i am trying to install vlc with pip and its telling me successfully installed python-vlc ok good that's what i wanted but when i go to run the program im trying to use vlc in witch is here
import vlc
p = vlc.MediaPlayer("https://www.youtube.com/watch?v=jC1vtG3oyqg")
p.play()
有人告诉我这个
Traceback (most recent call last):
File "C:\Users\Matt\Desktop\test2.py", line 1, in <module>
import vlc
File "C:\Python27\lib\site-packages\vlc.py", line 173, in <module>
dll, plugin_path = find_lib()
File "C:\Python27\lib\site-packages\vlc.py", line 150, in find_lib
dll = ctypes.CDLL('libvlc.dll')
File "C:\Python27\lib\ctypes\__init__.py", line 365, in __init__
self._handle = _dlopen(self._name, mode)
WindowsError: [Error 126] The specified module could not be found
我不确定我该怎么做,因为 vlc 程序中存在错误(我认为)如果您能帮助我并为我工作,那就太棒了,非常感谢!
im not sure what i am suppose to do since there are errors in the vlc program ( i think ) if you could help me out and get this working for me that would be amazing thank you so much!!
推荐答案
您的问题是 libvlc.dll
不在 PATH 中.有两种方法可以纠正.
Your problem is that libvlc.dll
is not in the PATH. There is 2 ways to correct that.
set PATH=%PATH%;<path to your dll folder>
如本文的第二个答案所述:将目录添加到Windows 中的 PATH 环境变量
As explained in the second answer of this post: Adding directory to PATH Environment Variable in Windows
此解决方案使变量在每次机器重新启动时保留在路径中,但您需要 root 权限.和以前一样,您需要按照本站点上的说明将路径放入 Path 变量中的 dll 文件夹.(这取决于您的系统版本):https://www.computerhope.com/issues/ch000549.htm
This solution makes the variable stay in the path for every reboot of your machine but you need root privilege. As before you need to put the way to your dll folder in the Path variable as explained on this site. (It depends from your system version): https://www.computerhope.com/issues/ch000549.htm
人们通常下载 32 位 vlc 的版本.如果您安装了 64 位版本的 python,这可能会导致一些麻烦.(Windows 错误 [193]
).要解决这个问题,你只需要重新安装 64 位 vlc 的版本.
Oftenly, people download 32bits vlc's version. This may cause some trouble if you installed the 64 bits version of python. (Windows Error [193]
). To fix that, you just need to reinstall the 64 bits vlc's version.
这篇关于python vlc安装问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!