方案一:
1.在VS内打开PowerShell(如果IDE是visual studio)
方案二:在cmd上直接安装
pip install --user bs4
如果遇到下图报错,需要保证网络能访问国外官网或者访问开源网站。
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘ProxyError(‘Cannot connect to proxy.’, NewConnectionError(’<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001D53B999048>: Failed to establish a new connection: [WinError 10061] 由于目标计算机积极拒绝,无法连接。’))’: /simple/url/
ERROR: Could not find a version that satisfies the requirement url (from versions: none)
ERROR: No matching distribution found for url
报错1
Python3安装BeautifulSoup报错Unit tests have failed!
解决方案:
pip install --user bs4
导入代码:
import bs4
from bs4 import BeautifulSoup