无法从“ bs4.element”导入名称“ HTMLAwareEntitySubstitution”

时间:2019-04-13 14:15:50

标签: python-3.x beautifulsoup

我已经安装了BeautifulSoup4-4.7.1,但是当我从“ bs4 import BeautifulSoup”运行时,它抛出了“无法从“ bs4.element”导入名称“ HTMLAwareEntitySubstitution”。我该怎么办?非常感谢。

from bs4 import BeautifulSoup

发生错误:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-12-f33cf0cb8fd3> in <module>
----> 1 from bs4 import BeautifulSoup

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/bs4/__init__.py in <module>
     32 import warnings
     33 
---> 34 from .builder import builder_registry, ParserRejectedMarkup
     35 from .dammit import UnicodeDammit
     36 from .element import (

/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/bs4/builder/__init__.py in <module>
      5 import itertools
      6 import sys
----> 7 from bs4.element import (
      8     CharsetMetaAttributeValue,
      9     ContentMetaAttributeValue,

ImportError: cannot import name 'HTMLAwareEntitySubstitution' from 'bs4.element' (/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/bs4/element.py)

0 个答案:

没有答案