我正在尝试安装漂亮的汤,这是问题所在
命令“ python setup.py egg_info”失败,错误代码为1 C:\ Users \ PC \ AppData \ Lo
cal \ Temp \ pip-install-n8bpi4nt \ BeautifulSoup \
这是我尝试安装BeautifulSoup时收到的错误
这是代码:
from bs4 import BeautifulSoup
import requests
search = input("Enter search term:")
params = {"q": search}
r = requests.get("https://www.bing.com/search", params=paramas)
soup = BeautifulSoup(r.text) # the text of the document passed into the class beautiful soup
print(soup.prettify())
这是错误:
from bs4 import BeautifulSoup
ModuleNotFoundError: No module named 'bs4'
请帮助,谢谢!
在python 3中,您需要安装beautifulsoup4(对于mac / ubuntu):pip3 install beautifulsoup4
或(Windows)pip install beautifulsoup4