【问题标题】:Harrison Python Web Programming stuck on scraping RSS feeds (3.4.2)Harrison Python Web 编程卡在抓取 RSS 提要 (3.4.2)
【发布时间】:2017-03-18 06:25:01
【问题描述】:

我正在学习“Harrison Python Web 编程”的 Python 课程,但被困在“抓取 RSS 提要 (3.4.2)”部分。

当我安装 BeautifulSoup4 时,它似乎安装得很好,但是当我执行代码时,我遇到了这个错误:

Traceback (most recent call last): File "C:/Users/Owen/Desktop/Owen/Electronics/Code/Python Web Programming XML.py", line 6, in <module> xml= BeautifulSoup(req, 'xml') File "C:\Users\Owen\AppData\Local\Programs\Python\Python35-32\lib\site-packages\bs4\__init__.py", line 165, 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?

我在网上浏览了一下,被告知我需要安装lxml。但是当我这样做时,我遇到了这个错误:

error: Unable to find vcvarsall.bat

谁能帮忙?

【问题讨论】:

标签: python beautifulsoup rss lxml


【解决方案1】:

您可能会看到"Error: Unable to find vcvarsall.bat",因为 pip 假定您安装了 MS Visual C++ 编译器。 (如果我没记错的话,pip 还假设你神奇地拥有正确版本的编译器。)

Futher reading

使用预编译的轮子通常会起作用。但是,根据 lxml:

如果您无法从已签名的 MS Windows 系统上构建 lxml 并测试我们发布的源代码,考虑使用二进制构建 来自 PyPI 或 Christoph Gohlke 的 unofficial Windows binaries 慷慨地提供。

【讨论】:

    猜你喜欢
    • 2012-03-04
    • 1970-01-01
    • 2023-01-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-30
    相关资源
    最近更新 更多