通过在python中运行boilerpipe库来解决问题

时间:2013-03-08 18:51:54

标签: java python jvm boilerpipe jpype

我曾尝试在python上使用boilerpipe库,旨在从大学项目的页面中提取文本。  我创建了一个简单的代码来进行提取:

from boilerpipe.extract import Extractor
def Article(url):
    extractor = Extractor(extractor='ArticleExtractor', url=your_url)
    extracted_text = extractor.getText()
    return extracted_text

我尝试运行时遇到的错误是:

>Traceback (most recent call last):
>  File "C:\Python27\Boiler.py", line 1, in <module>
>    from boilerpipe.extract import Extractor
>  File "C:\Python27\lib\site-packages\boilerpipe-1.2.0-py2.7.egg\boilerpipe\__init__.py", >line 10, in <module>
>    jpype.startJVM(jpype.getDefaultJVMPath(), "-Djava.class.path=%s" % >os.pathsep.join(jars))
>  File "C:\Python27\lib\site-packages\jpype\_core.py", line 44, in startJVM
>    _jpype.startup(jvm, tuple(args), True)
>RuntimeError: Unable to load DLL [C:\Program Files\Java\jre7\bin\client\jvm.dll], error = >Não foi possível encontrar o módulo especificado.
> at src/native/common/include\jp_platform_win32.h:58

我已经检查了JVM和JRE,并且它们已正确安装且设置了JAVA_HOME环境变量。

有谁知道如何解决它?

0 个答案:

没有答案