Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/python-2.7/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 2.7 属性错误:';模块';对象没有属性';德夫努尔';_Python 2.7_Nltk - Fatal编程技术网

Python 2.7 属性错误:';模块';对象没有属性';德夫努尔';

Python 2.7 属性错误:';模块';对象没有属性';德夫努尔';,python-2.7,nltk,Python 2.7,Nltk,当我运行上述代码时,我得到以下错误 from nltk.parse.corenlp import CoreNLPServer server = CoreNLPServer() server.start() 回溯(最近一次呼叫最后一次): 文件“server.py”,第30行,在 server.start() 文件“/usr/local/lib/python2.7/dist-packages/nltk/parse/corenlp.py”,第130行,开始 stderr=stderr, 文件“/u

当我运行上述代码时,我得到以下错误

from nltk.parse.corenlp import CoreNLPServer
server = CoreNLPServer()
server.start()
回溯(最近一次呼叫最后一次):
文件“server.py”,第30行,在
server.start()
文件“/usr/local/lib/python2.7/dist-packages/nltk/parse/corenlp.py”,第130行,开始
stderr=stderr,
文件“/usr/local/lib/python2.7/dist-packages/nltk/internals.py”,第112行,java语言
subprocess_output_dict={'pipe':subprocess.pipe,'stdout':subprocess.stdout,'devnull':subprocess.devnull}
AttributeError:“模块”对象没有属性“DEVNULL”
在Python 3.3中是新的

确保您使用的是stil支持Python 2.7的
nltk
版本。发件人:

Traceback (most recent call last):
  File "server.py", line 30, in <module>
    server.start()
  File "/usr/local/lib/python2.7/dist-packages/nltk/parse/corenlp.py", line 130, in start
    stderr=stderr,
  File "/usr/local/lib/python2.7/dist-packages/nltk/internals.py", line 112, in java
    subprocess_output_dict = {'pipe': subprocess.PIPE, 'stdout': subprocess.STDOUT, 'devnull': subprocess.DEVNULL}
AttributeError: 'module' object has no attribute 'DEVNULL'
Version 3.5 2019-10-16
* drop support for Python 2