在Pycharm上安装BeautfulSoup

问题描述 投票:0回答:1

我正在尝试安装漂亮的汤,这是问题所在

命令“ 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 python-3.x installation beautifulsoup pycharm
1个回答
0
投票

在python 3中,您需要安装beautifulsoup4(对于mac / ubuntu):pip3 install beautifulsoup4或(Windows)pip install beautifulsoup4

© www.soinside.com 2019 - 2024. All rights reserved.