本文共 767 字,大约阅读时间需要 2 分钟。
pp3 install gensim-3.8.1-cp37-cp37m-manylinux1_x86_64
pip3 install PyMySQL-master1.
_bz2.cpython-37m-x86_64-linux-gnu.so,如果下载的是36m,装的是37的python版本,将36改为37。同时将该包移动到python3安装目录的lib/python3.7/lib-dynload即可
下载地址:
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/