我使用beautifulsoup4在项目的目录中安装了requirment.txt:
requests==2.26.0 beautifulsoup4==4.9.3 html解析器
pip3 install -r requirement.txt --target='local_lib'当我试图导入和运行时,我得到了这个错误:
from local_lib.bs4 import BeautifulSoup
soup = Beautifulsoup(html, 'html.parser')
local_lib.bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: html-parser. Do you need to install a parser library?当我试图从bs4 (而不是local_lib.bs4 )导入时,它就起作用了。但是,我只想对模块使用local_lib目录。
为什么我为我的local_lib得到这个错误,以及如何修复它?
https://stackoverflow.com/questions/68612000
复制相似问题