从python2.7中的nltk.corpus(.reader)导入framenet:ImportError

从python2.7中的nltk.corpus(.reader)导入framenet:ImportError,python,python-2.7,nltk,importerror,Python,Python 2.7,Nltk,Importerror,我注意到我无法从nltk.corpus.reader或nltk.corpus导入framenet,并了解它在新版本的nltk中可用 $ python Python 2.7.5+ (default, Sep 19 2013, 13:48:49) [GCC 4.8.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import nltk >>&

我注意到我无法从nltk.corpus.reader或nltk.corpus导入framenet,并了解它在新版本的nltk中可用

$ python
Python 2.7.5+ (default, Sep 19 2013, 13:48:49) 
[GCC 4.8.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import nltk
>>> nltk.__version__
'3.0a2'
但是nltk.downloader显示了framenet_v15的一个条目,在文件系统中我有一个目录framnet_v15。 那我为什么不能导入呢

>>> from nltk.corpus import framenet
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name framenet
>>> from nltk.corpus.reader import framenet
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name framenet
>>从nltk.corpus导入framenet
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
ImportError:无法导入名称framenet
>>>从nltk.corpus.reader导入framenet
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
ImportError:无法导入名称framenet
如您所见:framenet语料库已经安装


示例

#!/usr/bin/env python

from nltk.corpus.reader import framenet
安装

  • 下载

  • tar-xzvf ntlk-3.0a3.tar.gz

  • cd nltk-3.0a3/

  • sudo python setup.py安装

  • 执行

    ./example.py


    你有样本代码吗?nltk的输出是什么。您需要3.0。这会引发一个错误:
    raise DistributionNotFound('No distribution match for%s'%req')pip.exceptions.DistributionNotFound:No distributions match for nltk==3.0的版本。我已更新了我的答案,以指导您安装NTLK 3。这帮助我将nltk 3.0安装到python2.7。但我仍然无法导入framenet。我更新了我的问题。你们有64位python安装吗?如果是,则替换为32位版本。64位版本中存在错误。