" Error: unable to start the CoreNLP server on port 9000" cannot use stanfordcorenlp via stanza

1.2k views Asked by At

I tried to use stanfordcorenlp via stanza and I installed them in anaconda. But when I try to run it, I always get

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

During handling of the above exception, another exception occurred:

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)

And I have no idea what happened. Please help!

1

There are 1 answers

0
StanfordNLPHelp On

You have something else taking port 9000. This may be a previous attempt at running the CoreNLP server or something else.

You should make sure you don't have any CoreNLP servers already running.

If something else on your machine is taking up port 9000, you can always just change the port the CoreNLP server uses with the port argument.