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