博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ImportError: cannot import name ‘HTMLParseError‘ from ‘html.parser‘ (/lib/python3.7/html/parser.py)
阅读量:4100 次
发布时间:2019-05-25

本文共 767 字,大约阅读时间需要 2 分钟。

1.gensim-3.8.1-cp37-cp37m-manylinux1_x86_64

pp3 install gensim-3.8.1-cp37-cp37m-manylinux1_x86_64

2.pymysql

pip3 install PyMySQL-master1.

3.bz2

_bz2.cpython-37m-x86_64-linux-gnu.so,如果下载的是36m,装的是37的python版本,将36改为37。同时将该包移动到python3安装目录的lib/python3.7/lib-dynload即可

4.from bs4 import BeautifulSoup安装

下载地址:

python3 setup.py install

由于没加路径,运行完上述命令再输入命令

2to3 -w bs4

再次在python3导入from bs4 import BeautifulSoup报错如下:

ImportError: cannot import name 'HTMLParseError' from 'html.parser' (/lib/python3.7/html/parser.py)

解决办法:/lib/python3.7/site-packages/bs4/builder/_init_.py

把下面几行注释掉:

from . import _htmlparser

register_treebuilders_from(_htmlparser)
try:
    from . import _html5lib
    register_treebuilders_from(_html5lib)
except ImportError:
    # They don't have html5lib installed.
    pass
 

转载地址:http://byrii.baihongyu.com/

你可能感兴趣的文章
移动端无插件上拉加载
查看>>
webpack基础
查看>>
webpack基础配置(1)
查看>>
webpack图片打包(2)
查看>>
centos7安装docker
查看>>
docker容器操作
查看>>
docker镜像制作
查看>>
激活Golang
查看>>
var _ HelloServiceInterface = (*HelloServiceClient)(nil)的特殊含义
查看>>
go语言(*Type).什么含义如var CloseFile = (*File).Close
查看>>
window系统下,设置mongodb远程访问
查看>>
centOS7最小安装设置网络
查看>>
Golang环境安装
查看>>
cannot find -lstdc++
查看>>
Centos修改ip方式
查看>>
centos7安装mongodb
查看>>
centos 7 关闭selinux
查看>>
window10与虚拟机共享一个文件目录
查看>>
以太坊安装常见失败场景
查看>>
vim常用操作
查看>>