Boilerpipe导入错误urllib2

时间:2016-02-10 05:30:21

标签: python boilerpipe

我成功安装了JPype和Boilerpipe Python包装器。

我的JAVA_HOME路径是正确的(据我所知)。

我使用以下代码创建了一个python文件:

from boilerpipe.extract import Extractor

extractor = Extractor(extractor='ArticleExtractor', url='http://edition.cnn.com/2016/02/09/politics/new-hampshire-primary-highlights/')

extracted_text = extractor.getText()

print(extracted_text)

运行python3 boiler_test.py

时出现此错误
Traceback (most recent call last):
  File "boiler_test.py", line 1, in <module>
    from boilerpipe.extract import Extractor
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/boilerpipe/extract/__init__.py", line 2, in <module> import urllib2
ImportError: No module named 'urllib2'

我该如何解决这个问题?

谢谢。

0 个答案:

没有答案