在Python3中导入'wikipedia'模块时出现'HTMLParseError'[重复]

时间:2023-01-14 23:16:29

This question already has an answer here:

这个问题在这里已有答案:

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

我使用pip install wikipedia在我的Windows 7机器上安装了“wikipedia”模块,但是当我运行这个简单的脚本时:

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?

我收到一条错误,指出ImportError:无法导入名称'HTMLParseError'。我正在使用Python 3.5版和最新版本的*模块。还有另一个图书馆会给我这个功能吗?

1 个解决方案

#1


Reference to this

参考这个

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

这是beutifulsoup的新版本中的一个错误,尝试这样做。

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

#1


Reference to this

参考这个

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

这是beutifulsoup的新版本中的一个错误,尝试这样做。

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