无法在python中导入beautifulsoup

Pie*_*are 2 python python-module beautifulsoup python-2.7

我正在使用Python.7.10并使用pip安装了beautifulsoup.该软件包已成功安装.但是当我尝试导入beautifulsoup时,我收到了这个错误:

ImportError: No module named beautifulsoup
Run Code Online (Sandbox Code Playgroud)

我查看了已安装模块的列表,并在已安装的模块列表中找到了beautifulsoup模块:

美丽的汤安装图片

导入时出错

已安装的模块列表

Mar*_*ers 8

你安装了BeautifulSoup版本3; 该模块被称为BeautifulSoup资本BS:

from BeautifulSoup import BeautifulSoup
Run Code Online (Sandbox Code Playgroud)

请参阅快速入门文档.

你真的想升级到BeautifulSoup 4. BeautifulSoup 3于2012年停产.

要安装版本4,请使用:

pip install beautifulsoup4
Run Code Online (Sandbox Code Playgroud)

和导入bs4:

from bs4 import BeautifulSoup
Run Code Online (Sandbox Code Playgroud)

在继续之前,请先研究项目文档.