python - nltk 无法找到 mace4

标签 python nltk

在执行以下代码时,出现上述错误。

我从 http://www.cs.unm.edu/~mccune/prover9/download/ 下载了所需的包并配置。但仍然是同样的问题。

我收到这个错误:

>>> import nltk
>>> dt = nltk.DiscourseTester(['A student dances', 'Every student is a person'])
>>> dt.readings()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/nltk/inference/discourse.py", line 351, in readings
    self._construct_threads()
  File "/usr/local/lib/python2.7/dist-packages/nltk/inference/discourse.py", line 297, in _construct_threads
    consistency_checked = self._check_consistency(self._threads)
  File "/usr/local/lib/python2.7/dist-packages/nltk/inference/discourse.py", line 393, in _check_consistency
    modelfound = mb.build_model()
  File "/usr/local/lib/python2.7/dist-packages/nltk/inference/api.py", line 333, in build_model
    verbose)
  File "/usr/local/lib/python2.7/dist-packages/nltk/inference/mace.py", line 202, in _build_model
    verbose=verbose)
  File "/usr/local/lib/python2.7/dist-packages/nltk/inference/mace.py", line 215, in _call_mace4
    self._mace4_bin = self._find_binary('mace4', verbose)
  File "/usr/local/lib/python2.7/dist-packages/nltk/inference/prover9.py", line 166, in _find_binary
    verbose=verbose)
  File "/usr/local/lib/python2.7/dist-packages/nltk/internals.py", line 544, in find_binary
    binary_names, url, verbose))
  File "/usr/local/lib/python2.7/dist-packages/nltk/internals.py", line 538, in find_binary_iter
    url, verbose):
  File "/usr/local/lib/python2.7/dist-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 mace4 file!
Use software specific configuration paramaters or set the PROVER9HOME environment variable.

  Searched in:
    - /usr/local/bin/prover9
    - /usr/local/bin/prover9/bin
    - /usr/local/bin
    - /usr/bin
    - /usr/local/prover9
    - /usr/local/share/prover9

通过make all配置LADR-2009-11时,结束进程

.o utilities.o provers.o foffer.o ../ladr/libladr.a
search.o: In function `search':
search.c:(.text+0x6e54): undefined reference to `round'
../ladr/libladr.a(avltree.o): In function `avl_item_at_position':
avltree.c:(.text+0x7cb): undefined reference to `ceil'
collect2: error: ld returned 1 exit status
make[1]: *** [prover9] Error 1
make[1]: Leaving directory `/root/Desktop/karim/software/LADR-2009-11A/provers.src'
make: *** [all] Error 2

最佳答案

这是对我有用的。我在 github 上找到了它 issue 193

简述

  • 下载gui
  • 下载dll
  • 将下载的 dll 放在 C:\Program Files (x86)\Prover9-Mace4
  • 创建 Windows 系统环境变量 PROVER9 并将其设置为 C:\Program Files (x86)\Prover9-Mace4\bin-win32

关于python - nltk 无法找到 mace4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25844794/

相关文章:

python - 如何使用 Python 重新路由网络流量?

python - 使用senti_classifier和NLTK进行情感分析

nltk - 是否可以加速 Wordnet Lemmatizer?

python - 保存和加载测试以另一种方法对 NLTK 中的朴素贝叶斯分类器进行分类

python - 在 neo4j 算法查询中提交参数

python - 在图表下设置颜色图

error-handling - Python,导入错误: MaxentClassifier

python - 将形容词转换为副词

python - 从左到右均匀地在单词之间添加空格,直到一定长度

python - 为什么 cx_oracle execute() 现在不喜欢我的字符串?