【Python】ModuleNotFoundError: No module named ‘bs4‘;ERROR: Could not find a version that satisfies th

程序运行报错: 

D:\PyCharm_Project\venv\Scripts\python.exe D:/PyCharm_Project/Scrap.py
Traceback (most recent call last):
  File "D:/PyCharm_Project/Scrap.py", line 2, in <module>
    from bs4 import BeautifulSoup
ModuleNotFoundError: No module named 'bs4'

ERROR: Could not find a version that satisfies the requirement bs4 ERROR: No matching distribution found for bs4 

ERROR: Could not find a version that satisfies the requirement BeautifulSoup4 ERROR: No matching distribution found for BeautifulSoup4

首先安装beautifulsoup4,直接在电脑cmd中安装:区分python版本,当前是python3.0

pip3 install beautifulsoup4

 可能遇到的问题,网络代理的问题,把代理关掉,正常网络下载;

 在PyCharm中执行程序,还是报错提示“ModuleNotFoundError: No module named 'bs4'”,需要手动添加;

找到D:\Program Files (x86)\python3.9.4\Lib\site-packages\bs4;

在PyCharm中打开Setting:

 

 至此bs4安装完成。

 参考资料:

python - ImportError: No Module Named bs4 (BeautifulSoup) - Stack Overflowhttps://stackoverflow.com/questions/11783875/importerror-no-module-named-bs4-beautifulsouppip - ERROR: Could not find a version that satisfies the requirement virualenv (from versions: none) during the installation of beautifulsoup - Stack Overflowhttps://stackoverflow.com/questions/58993826/error-could-not-find-a-version-that-satisfies-the-requirement-virualenv-from-v

常见插件安装

pip install bs4 Code Examplepip install beautifulsoup4https://www.codegrepper.com/code-examples/shell/pip+install+bs4 

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值