0

我尝试通过 stanza 使用 stanfordcorenlp,并将它们安装在 anaconda 中。但是当我尝试运行它时,我总是得到

OSError                                   Traceback (most recent call last)
/opt/anaconda3/lib/python3.7/site-packages/stanza/server/client.py in start(self)
    130                     try:
--> 131                         sock.bind((self.host, self.port))
    132                     except socket.error:

OSError: [Errno 48] Address already in use

在处理上述异常的过程中,又出现了一个异常:

PermanentlyFailedException                Traceback (most recent call last)
<ipython-input-1-521fed6e064f> in <module>
      4         annotators=['tokenize','ssplit','pos','lemma','ner', 'parse', 'depparse','coref'],
      5         timeout=30000,
----> 6         memory='16G') as client:
      7     ann = client.annotate(text)

/opt/anaconda3/lib/python3.7/site-packages/stanza/server/client.py in __enter__(self)
    174 
    175     def __enter__(self):
--> 176         self.start()
    177         return self
    178 

/opt/anaconda3/lib/python3.7/site-packages/stanza/server/client.py in start(self)
    137                         else:
    138                             raise PermanentlyFailedException("Error: unable to start the CoreNLP server on port %d "
--> 139                                                          "(possibly something is already running there)" % self.port)
    140             if self.be_quiet:
    141                 # Issue #26: subprocess.DEVNULL isn't supported in python 2.7.

PermanentlyFailedException: Error: unable to start the CoreNLP server on port 9000 (possibly something is already running there)

我不知道发生了什么。请帮忙!

4

1 回答 1

1

你有其他东西占用了端口 9000。这可能是之前运行 CoreNLP 服务器或其他东西的尝试。

您应该确保没有任何 CoreNLP 服务器已经在运行。

如果你机器上的其他东西占用了端口 9000,你可以随时更改 CoreNLP 服务器使用的端口和port参数。

于 2020-09-18T00:18:51.653 回答