Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 运行beautifulsoup时出错(模块';html5lib.treebuilders';没有属性';#u base';)_Python_Python 3.x_Beautifulsoup_Jupyter Notebook_Html5lib - Fatal编程技术网

Python 运行beautifulsoup时出错(模块';html5lib.treebuilders';没有属性';#u base';)

Python 运行beautifulsoup时出错(模块';html5lib.treebuilders';没有属性';#u base';),python,python-3.x,beautifulsoup,jupyter-notebook,html5lib,Python,Python 3.x,Beautifulsoup,Jupyter Notebook,Html5lib,我不熟悉编程和Python。我正在尝试在Python3上安装BeutifulSoup来学习MOOC的网络抓取(使用Jupyter笔记本作为IDE)。当我从bs4 import BeautifulSoup运行时,我收到以下错误 AttributeError回溯(最近一次呼叫上次) 在里面 3导入ssl 4打印(“完成2”) ---->5来自bs4进口集团 6打印(“done3”) ~\Desktop\py4e\code3\code3\bs4\uuuu init\uuuuu.py in 28进口警告

我不熟悉编程和Python。我正在尝试在Python3上安装BeutifulSoup来学习MOOC的网络抓取(使用Jupyter笔记本作为IDE)。当我从bs4 import BeautifulSoup运行
时,我收到以下错误

AttributeError回溯(最近一次呼叫上次) 在里面 3导入ssl 4打印(“完成2”) ---->5来自bs4进口集团 6打印(“done3”)

~\Desktop\py4e\code3\code3\bs4\uuuu init\uuuuu.py in 28进口警告 29 --->30从.builder导入builder_注册表,parserjectedmarkup 31.该死的进口Unicodammit 32.元素导入(

~\Desktop\py4e\code3\code3\bs4\builder\uuuu init\uuuuu.py in' 312从(\u htmlparser)注册树生成器 313尝试: -->314 from.import\u html5lib 315从(_html5lib)注册树生成器 316除恐怖主义外:

~\Desktop\py4e\code3\code3\bs4\builder\u html5lib.py in 68 69 --->70类TreeBuilderForHtml5lib(html5lib.treebuilders.\u base.TreeBuilder): 71 72 definit(self、soup、namespacehtmlements):

AttributeError:模块“html5lib.treebuilders”没有属性 "基地"

我尝试了以下解决方案:

1)
pip安装html5lib==0.999999
2)
pip安装——升级html5lib==1.0b8
3)
pip安装--升级漂白剂==1.4.2
3) 更新BeutifulSoup(pip安装) 4) 降级后重新安装html5lib至最新版本无效


非常感谢您的帮助

您是如何安装
beautifulsoup4
?我最初使用的是'pip install beautifulsoup4'。我还制作了一份副本,并将其放在我正在处理的文件中。最近我使用了pip安装——升级bs4(要求是最新的)也许可以试试这个:我很高兴:)cheershow你安装了
beautifulsoup4
?我最初使用的是“pip安装beautifulsoup4”。我还制作了一份副本,并将其放在我正在处理的文件中。最近我使用了pip安装——升级bs4(要求是最新的)也许可以试试这个:我很高兴:)干杯