Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/85.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 BS4错误:没有名为html.entities的模块_Python_Html - Fatal编程技术网

Python BS4错误:没有名为html.entities的模块

Python BS4错误:没有名为html.entities的模块,python,html,Python,Html,所以我用PIP安装了BS4,但是当我安装的时候 from bs4 import beautifulsoup4 我明白了 ImportError: No module named html.entities 我已经做了所有我能做的研究,因为这似乎是一个相当罕见的问题,我唯一能找到的就是只安装了一个版本的python,但是我需要同时安装python 2和python 3,这样就不起作用了 所以我想知道是否有更好的方法来修复这个错误,顺便说一句,我已经读到了,里面似乎没有任何东西对我的情况有帮助

所以我用PIP安装了BS4,但是当我安装的时候

from bs4 import beautifulsoup4
我明白了

ImportError: No module named html.entities
我已经做了所有我能做的研究,因为这似乎是一个相当罕见的问题,我唯一能找到的就是只安装了一个版本的python,但是我需要同时安装python 2和python 3,这样就不起作用了

所以我想知道是否有更好的方法来修复这个错误,顺便说一句,我已经读到了,里面似乎没有任何东西对我的情况有帮助


谢谢你的帮助!很抱歉我的格式设置

您使用的是Python 2还是Python 3
html.entities
仅在Python 3中。应该从bs4导入beautifulsoup4be
从bs4导入BeautifulSoup
吗?我错了,我将其编写为BeautifulSoup,我正在使用3。您是否尝试过此软件包。注意,我没有测试它,因为我的机器上有Python 3.8。值得一试?