简体   繁体   English

使用MediaInfo加上包装器的Python错误

[英]Python error using MediaInfo plus wrapper

I'm currently trying to get the module pymediainfo, which is installed on every machine i try this on and installs with no errors. 我目前正在尝试获取模块pymediainfo,它安装在我尝试此操作的每台机器上并安装没有错误。

For more info on pymediainfo go here (There isn't a lot hence why i'm here): https://pymediainfo.readthedocs.org/en/latest/# 有关pymediainfo的更多信息,请访问(这里没有很多因为我在这里): https ://pymediainfo.readthedocs.org/en/latest/#

Anyway i'm trying to access read and output the xml data in video files for video stats, like bitrate and whatnot, but on every machine but my own home machine, i get this error: 无论如何,我正在尝试访问读取并输出视频统计数据的视频统计中的xml数据,比如bitrate和诸如此类的东西,但是在每台机器上,但我自己的家用机器,我得到这个错误:

Traceback (most recent call last):
  File "/usr/bin/mvandmake", line 253, in <module>
    main()
  File "/usr/bin/mvandmake", line 250, in main
    newfile = makefile(todo + "/" + filename + ".mkv")
  File "/usr/bin/mvandmake", line 125, in __init__
    self.media_info = MediaInfo.parse(self.filename)
  File "/usr/local/lib/python2.7/dist-packages/pymediainfo-1.3.6-py2.7.egg/pymediainfo/__init__.py", line 98, in parse
    xml_dom = MediaInfo.parse_xml_data_into_dom(fp_out.read())
  File "/usr/local/lib/python2.7/dist-packages/pymediainfo-1.3.6-py2.7.egg/pymediainfo/__init__.py", line 85, in parse_xml_data_into_dom
    return BeautifulSoup(xml_data, "xml")
  File "/usr/local/lib/python2.7/dist-packages/beautifulsoup4-4.3.1-py2.7.egg/bs4/__init__.py", line 152, in __init__
    % ",".join(features))
bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?

I cannot for the life of me figure out what is missing in terms of dependencies, i don't know if this goes here but it is a python script. 我不能为我的生活弄清楚依赖关系方面缺少什么,我不知道这是否在这里,但它是一个python脚本。 If anyone has any ideas or a way for me to check my machine for installed xml parser libraries, that'd be fantastic. 如果有人有任何想法或方法让我检查我的机器上安装的xml解析器库,那就太棒了。 Thanks in advance. 提前致谢。

- Brian - 布莱恩

You have an error in BeautifulSoup not in MediaInfo itself. 您在BeautifulSoup中有错误,而不是MediaInfo本身。 You need to install the lxml library. 您需要安装lxml库。

In your python console try: 在你的python控制台中尝试:

import lxml

If this doesn't import correctly try installing lxml with pip 如果没有正确导入,请尝试使用pip安装lxml

pip install lxml

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

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