【问题标题】:How can I install BeautifulSoup in a Digital Ocean droplet?如何在 Digital Ocean 液滴中安装 BeautifulSoup?
【发布时间】:2025-12-30 04:05:05
【问题描述】:

我使用的是最基本的服务,在 Ubuntu(标准配置)下运行,我在自己的 PC 上开发了一些使用 bs4 的 python 脚本,当我上传它们时,它说经典错误:

bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: xml. Do you need to install a parser library?

所以我尝试pip install lxml,它要求安装libxml2,依此类推……

我不是 Linux 人,我更喜欢 Windows,我知道也许我必须编译一些东西,但我不知道什么或如何编译。一直在找教程,找不到有用的东西。

【问题讨论】:

    标签: python beautifulsoup digital-ocean


    【解决方案1】:

    如果您使用ubuntu,使用apt-get install python-bs4apt-get install python3-bs4安装预打包版本会更容易

    【讨论】: