Python ImportError:没有名为bs4 Atom的模块
我正在使用Atom(1.53.0)使用BeautifulSoup进行网页抓取 我在以下行中收到一条错误消息:Python ImportError:没有名为bs4 Atom的模块,python,beautifulsoup,atom-editor,importerror,Python,Beautifulsoup,Atom Editor,Importerror,我正在使用Atom(1.53.0)使用BeautifulSoup进行网页抓取 我在以下行中收到一条错误消息: from bs4 import BeautifulSoup 内容如下: ImportError: No module named bs4 在终端中执行以下命令时: pip install beautifulsoup4 我得到的结果是: Requirement already satisfied: beautifulsoup4 in ./opt/anaconda3/lib/pytho
from bs4 import BeautifulSoup
内容如下:
ImportError: No module named bs4
在终端中执行以下命令时:
pip install beautifulsoup4
我得到的结果是:
Requirement already satisfied: beautifulsoup4 in ./opt/anaconda3/lib/python3.7/site-packages (4.8.2)
Requirement already satisfied: soupsieve>=1.2 in ./opt/anaconda3/lib/python3.7/site-packages (from beautifulsoup4) (1.9.5)
我注意到,当我关闭atom并重新打开它时,问题可以得到解决。但是,始终关闭atom是非常不方便的。有没有办法解决这个问题
(一些信息)
Python版本:3.7.6
MacOs版本:10.15.5
Atom版本:1.53.0
提前谢谢 错误是未找到
bs4
模块,因此请尝试安装bs4
而不是beautifulsoup4
pip install bs4
当您面临此问题时,虚拟环境是否已激活?