beautifulsoup4不起作用

时间:2018-04-24 12:16:36

标签: python django

我已经安装了beautifulsoup4但它不起作用。

这是我第二次尝试安装:

(k36) C:\GROWTHTECH\Projetos\blockchain>python -m pip install beautifulsoup4
Requirement already satisfied: beautifulsoup4 in c:\users\patff\appdata\local\conda\conda\envs\k36\lib\site-packages\beautifulsoup4-4.6.0-py3.6.egg
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

当我做测试时:

>>> import beautifulsoup4
Traceback (most recent call last):
  File "<console>", line 1, in <module>
ModuleNotFoundError: No module named 'beautifulsoup4'
>>> from BeautifulSoup import BeautifulSoup
Traceback (most recent call last):
  File "<console>", line 1, in <module>
ModuleNotFoundError: No module named 'BeautifulSoup'
>>> exit()

1 个答案:

答案 0 :(得分:0)

版本4 [1] [2]BeautifulSoup的官方导入名称已更改为bs4。如果安装正确,请通过调用以下方式导入包:

import bs4