因此,当我在pycharm中导入此模块时,如下所示:
from bs4 import beautifulsoup
它给了我一个错误:
Cannot find reference "beautifulsoup" in "__init__.py"
我搜索过它,但我不知道如何解决它。我是一个初学者,btw,我使用python 3.9.1
首先,导入语句应该是这样的:
from bs4 import BeautifulSoup
假设您已经安装了pip
:
pip install bs4