1

I'm trying to get python works in Eclipse with me. I did download Pydev and wrote a small python code.

my python version is: Python 2.7.6 on my Mac OS X 10.9.2

the error I'm receiving now is(BTW I'm getting this error with Jython 2.5.4rc1 and Python interpreters):

Traceback (most recent call last):
  File "/Users/ha/EclipseProjects/PythonNLTK/Code.py", line 11, in <module>
    import nltk
  File "/Library/Python/2.7/site-packages/nltk/__init__.py", line 99, in <module>
    from collocations import *
  File "/Library/Python/2.7/site-packages/nltk/collocations.py", line 38, in <module>
    from nltk.metrics import ContingencyMeasures, BigramAssocMeasures, TrigramAssocMeasures
  File "/Library/Python/2.7/site-packages/nltk/metrics/__init__.py", line 23, in <module>
    from nltk.metrics.segmentation    import windowdiff, ghd, pk
  File "/Library/Python/2.7/site-packages/nltk/metrics/segmentation.py", line 45, in <module>
    import numpy
  File "/Library/Python/2.7/site-packages/nltk/metrics/segmentation.py", line 45, in <module>
    import numpy
  File "/Library/Python/2.7/site-packages/numpy/__init__.py", line 107
SyntaxError: future feature print_function is not defined

How can I solve it?

4

1 回答 1

1

只有 python 2.7+ 具有 print_function 未来导入。

如果你升级到Jython 2.7 Beta 2我敢打赌这个问题会得到解决

于 2014-05-31T22:39:00.947 回答