0

我正在运行duckling.py 来进行一些实体提取。

有人可以告知导致以下错误的原因吗?

有人建议这解决了他们的问题,但我无法安装它(可能是因为我使用的是 Windows??)

“康达安装 libgcc”

这是导致回溯的代码:

def _start_jvm(self, minimum_heap_size, maximum_heap_size):
  jvm_options = [
    '-Xms{minimum_heap_size}'.format(minimum_heap_size = minimum_heap_size),
    '-Xmx{maximum_heap_size}'.format(maximum_heap_size = maximum_heap_size),
    '-Djava.class.path={classpath}'.format(
      classpath = self._classpath)
  ]
if not jpype.isJVMStarted():
  jpype.startJVM(
    jpype.getDefaultJVMPath(),
    * jvm_options
  )

这是回溯:

Traceback(most recent call last):

File "<ipython-input-5-e568931e00a0>", line 1, in < module > runfile('C:/Users/user/.spyder-py3/chatbot/Outlook/intent finder.py', wdir ='C:/Users/user/.spyder-py3/chatbot/Outlook')

File "C:\Users\user\AppData\Local\Continuum\anaconda3\lib\site packages\spyder\utils\site\sitecustomize.py", line 705, in runfile execfile(filename, namespace)

File "C:\Users\user\AppData\Local\Continuum\anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/user/.spyder-py3/chatbot/Outlook/intent finder.py", line 19, in < module > numbersmodel = Interpreter.load(r 'C:\Users\user\.spyder-py3\chatbot\Outlook\numbers\default\model')

File "C:\Users\user\.spyder-py3\chatbot\Outlook\rasa_nlu\model.py", line 276, in load skip_validation)

File "C:\Users\user\.spyder-py3\chatbot\Outlook\rasa_nlu\model.py", line 303, in create model_metadata, ** context)

File "C:\Users\user\.spyder-py3\chatbot\Outlook\rasa_nlu\components.py", line 400, in load_component cached_component, ** context)

File "C:\Users\user\.spyder-py3\chatbot\Outlook\rasa_nlu\registry.py", line 131, in load_component_by_name return component_clz.load(model_dir, metadata, cached_component, ** kwargs)

File "C:\Users\user\.spyder-py3\chatbot\Outlook\rasa_nlu\extractors\duckling_extractor.py", line 194, in load duckling = cls.create_duckling_wrapper(language)

File "C:\Users\user\.spyder-py3\chatbot\Outlook\rasa_nlu\extractors\duckling_extractor.py", line 108, in create_duckling_wrapper return DucklingWrapper(language = language)

File "C:\Users\user\.spyder-py3\chatbot\Outlook\duckling\wrapper.py", line 35, in __init__maximum_heap_size = maximum_heap_size)

File "C:\Users\user\.spyder-py3\chatbot\Outlook\duckling\duckling.py", line 44, in __init__self._start_jvm(minimum_heap_size, maximum_heap_size)

File "C:\Users\user\.spyder-py3\chatbot\Outlook\duckling\duckling.py", line 67, in _start_jvm if not jpype.isJVMStarted():

AttributeError: module 'jpype' has no attribute 'isJVMStarted'

4

1 回答 1

0

所以我终于解决了它,我会在这里发布答案,以防将来对任何人有帮助。

我确实在我的 Miniconda 目录下安装了所有必需的软件包:

AppData\Local\Continuum\miniconda3\Lib\site-packages

但是,我的 PYTHONPATH 只查看以下未安装模块的路径:

AppData\Local\Continuum\anaconda3\Lib\site-packages

所以我做了一个附加来解决它并且它有效:

import sys
sys.path.append(r'C:\Users\users\AppData\Local\Continuum\miniconda3\Lib\site-packages')
于 2018-07-07T15:06:41.113 回答