简体   繁体   中英

Unable to import beautifulsoup in python

I'm using Python.7.10 and have installed beautifulsoup using pip. The package was installed successfully. But when I'm trying to import beautifulsoup, I'm getting this error:

ImportError: No module named beautifulsoup

I checked the list of my installed modules and I found the beautifulsoup module in the installed modules list:

美丽的汤安装图片

导入时出错

已安装的模块列表

You installed BeautifulSoup version 3; the module is called BeautifulSoup with capital B and S :

from BeautifulSoup import BeautifulSoup

See the Quickstart documentation .

You really want to upgrade to BeautifulSoup 4. BeautifulSoup 3 was discontinued in 2012.

To install version 4, use:

pip install beautifulsoup4

and import bs4 :

from bs4 import BeautifulSoup

Do study the project documentation before continuing however.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM