gpt4 book ai didi

python - 即使安装了 BeautifulSoap 的 ImportError

转载 作者:太空宇宙 更新时间:2023-11-04 02:27:22 24 4
gpt4 key购买 nike

<分区>

我一直在尝试导入 BeautifulSoap(Beautiful Soap 4,而不是 3)

从 bs4 导入 BeautifulSoap

但我不断收到 ImportError:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'BeautifulSoap'

我已经通过 pip 安装了 BeautifulSoap4,通过 pip install bs4pip install --upgrade --force-reinstall beautifulsoup4。出于某种原因,pip install beautifulsoap4 给我:

Could not find a version that satisfies the requirement beautifulsoap4 (from versions: )
No matching distribution found for beautifulsoap4

无论如何,只需使用 import bs4 导入 bs4 就不会出现任何错误。我的 Python 文件都没有命名为 bs4.py 或 beautifulsoap.py 或任何类似的名称。有谁知道为什么会这样?我一直在寻找过去一个小时的原因:(

提前致谢!

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com