芹菜引发了意外的查找错误

Celery raised unexpected LookUp Error

我正在为我的 Django 项目使用芹菜。

java_path = "/your/Java/jdk/home/java.exe
os.environ['JAVAHOME'] = java_path

st = POSTagger('/your/postagger/models/path/english-bidirectional-distsim.tagger','/your/postagger/jar/file/path/stanford-postagger.jar')

tag = st.tag([key])

这里的键是一个特征词列表。

使用 celery 执行时出现以下错误:

raised unexpected: 
           LookupError('\n\n===========================================================================\nNLTK 
        `was unable to find the java file!\nUse software specific configuration paramaters or set the JAVAHOME environment`



variable.\n===========================================================================',)
        Traceback (most recent call last):
          File "/Users/Envs/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
            R = retval = fun(*args, **kwargs)
          File "/Users/Envs/lib/python2.7/site-packages/celery/app/trace.py", line 438, in __protected_call__
            return self.run(*args, **kwargs)
          File "/Users/Envs/src/evolvelearning/tasks.py", line 772, in RunProgram
            tag = st.tag([key])
          File "/Users/Envs/lib/python2.7/site-packages/nltk/tag/stanford.py", line 59, in tag
            return self.tag_sents([tokens])[0]
        File "/Users/Envs/lib/python2.7/site-packages/nltk/tag/stanford.py", line 64, in tag_sents
        config_java(options=self.java_options, verbose=False)
      File "/Users/Envs/lib/python2.7/site-packages/nltk/internals.py", line 82, in config_java
        _java_bin = find_binary('java', bin, env_vars=['JAVAHOME', 'JAVA_HOME'], verbose=verbose, binary_names=['java.exe'])


        File "/Users/Envs/lib/python2.7/site-packages/nltk/internals.py", line 544, in find_binary
            binary_names, url, verbose))
          File "/Users/Envs/lib/python2.7/site-packages/nltk/internals.py", line 538, in find_binary_iter
            url, verbose):
          File "/Users/Envs/lib/python2.7/site-packages/nltk/internals.py", line 517, in find_file_iter
            raise LookupError('\n\n%s\n%s\n%s' % (div, msg, div))
        LookupError:

        ===========================================================================
    NLTK was unable to find the java file!
    Use software specific configuration paramaters or set the JAVAHOME environment variable.
    ===========================================================================

我已经设置了java_pathjavahome,我想知道为什么还会出现这些错误?

我的环境是MAC.

问题是java_path,应该是:

java_path = "/your/Java/jdk/home