'HTMLParseError' when importing 'wikipedia' module in Python3 [duplicate]

早过忘川 提交于 2020-03-05 10:47:06

问题


I installed the 'wikipedia' module on my Windows 7 machine with pip install wikipedia, but when I run this simple script:

import wikipedia
print (wikipedia.summary("Wikipedia"))

I get an error that says ImportError: cannot import name 'HTMLParseError'. I'm using Python version 3.5 and the latest version of the wikipedia module. Is there another library that will give me this function?


回答1:


Reference to this

It's a bug in newer version of beutifulsoup, try doing this.

git clone https://github.com/jjangsangy/BeautifulSoup4 \
    && cd BeautifulSoup4 \
    && python3.5 setup.py install


来源:https://stackoverflow.com/questions/30215242/htmlparseerror-when-importing-wikipedia-module-in-python3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!