AttributeError:“模块”对象没有属性“ DEVNULL”

犯罪犬
from nltk.parse.corenlp import CoreNLPServer
server = CoreNLPServer()
server.start()

当我运行上面的代码时,出现以下错误。

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'
威姆

subprocess.devnull 是Python 3.3中的新增功能。

确保使用nltkstil支持Python 2.7的版本他们的变更日志中

Version 3.5 2019-10-16
* drop support for Python 2

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

AttributeError:“模块”对象没有属性“ TestCase”

AttributeError:“模块”对象没有属性“测试”

AttributeError:“模块”对象没有属性“授权”

AttributeError:“模块”对象没有属性“计算”

AttributeError:“模块”对象没有属性“版本”

AttributeError:“模块”对象没有属性“ grd”

AttributeError:“模块”对象没有属性“打开”

AttributeError:“模块”对象没有属性“ mkdirs”

AttributeError:“模块”对象没有属性“ cm”

AttributeError:“'模块'对象没有属性'ARRAY'”

AttributeError:“模块”对象没有属性“连接”

继承AttributeError:“模块”对象没有属性

AttributeError:'模块'对象没有属性'urlopen'

AttributeError:“模块”对象没有属性“ xxxx”

AttributeError:'模块'对象没有属性'utcnow'

AttributeError:“模块”对象没有属性“错误”

AttributeError:“模块”对象没有属性“请求”

AttributeError:“模块”对象没有属性“蜘蛛”

AttributeError:“模块”对象没有属性“ SignedJwtAssertionCredentials”

AttributeError:“模块”对象没有属性

AttributeError:'模块'对象没有属性'urlretrieve'

AttributeError:'模块'对象没有属性'setdefaultencoding'

AttributeError:“模块”对象没有属性“选择”

AttributeError:“模块”对象没有属性“ startfile”

AttributeError:“模块”对象没有属性“得分”

AttributeError:“模块”对象没有属性“ cbook”

AttributeError:“模块”对象没有属性“ SFrame”

AttributeError:“模块”对象没有属性“ URL”

AttributeError:“模块”对象没有属性“ TwilioRestClient”