language-check
language-check copied to clipboard
http://127.0.0.1:8081: Remote end closed connection without response
Running on ubuntu18.04. Reinstalled OS a week ago and tried to use language tool only to keep getting the same error.
Installed language tool using upgraded pip
pip install --user --upgrade language-check
`Python 3.6.8 (default, Jan 14 2019, 11:02:34) [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux Type "help", "copyright", "credits" or "license" for more information.
import language_check tool = language_check.LanguageTool('en-US') text = u'A sentence with a error in the Hitchhiker’s Guide tot he Galaxy' matches = tool.check(text) Traceback (most recent call last): File "/home/victor/.local/lib/python3.6/site-packages/language_check/init.py", line 319, in _get_root with urlopen(url, data, cls._TIMEOUT) as f: File "/usr/lib/python3.6/urllib/request.py", line 223, in urlopen return opener.open(url, data, timeout) File "/usr/lib/python3.6/urllib/request.py", line 526, in open response = self._open(req, data) File "/usr/lib/python3.6/urllib/request.py", line 544, in _open '_open', req) File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain result = func(*args) File "/usr/lib/python3.6/urllib/request.py", line 1346, in http_open return self.do_open(http.client.HTTPConnection, req) File "/usr/lib/python3.6/urllib/request.py", line 1321, in do_open r = h.getresponse() File "/usr/lib/python3.6/http/client.py", line 1331, in getresponse response.begin() File "/usr/lib/python3.6/http/client.py", line 297, in begin version, status, reason = self._read_status() File "/usr/lib/python3.6/http/client.py", line 266, in _read_status raise RemoteDisconnected("Remote end closed connection without" http.client.RemoteDisconnected: Remote end closed connection without response During handling of the above exception, another exception occurred: Traceback (most recent call last): File "
", line 1, in File "/home/victor/.local/lib/python3.6/site-packages/language_check/init.py", line 250, in check root = self._get_root(self._url, self._encode(text, srctext)) File "/home/victor/.local/lib/python3.6/site-packages/language_check/init.py", line 326, in _get_root raise Error('{}: {}'.format(cls._url, e)) language_check.Error: http://127.0.0.1:8081: Remote end closed connection without response
`
+1, similar circumstance. Upgrade/rebuild of OS from 16.04 to 18.04 LTS, python 3.6.8 , working my way through getting my app up back to a running state, and got this error on the new install.
Got the same error, working now by adding this line url=url+"/Languages" in _get_root()
Hi, has anyone been able to solve this? Getting the same issue.
@skure can you explain a little more
Edit init.py around line 315 which in my system is ~/.local/lib/python3.6/site-packages/language_check/init.py
line 315: @classmethod def _get_root(cls, url, data=None, num_tries=2): url=url+"/Languages" for n in range(num_tries):
Adding that line seemed to get my instance to start working Let us know if that helps.
@kinoc it worked perfectly thanks =)
@kinoc didn't work for me... Any alternative solution out there?
Hi! Since this project has been abandoned, I started a new fork over at https://github.com/jxmorris12/language_tool_python.
My version supports new versions of Java and LanguageTool. language-check
is stuck on Java 8 and LanguageTool 3.2; latest versions are Java 14 and LanguageTool 4.9!
I'm happy to help you with your issue if you raise it over at my repository! Thanks!
I faced the same issue and I removed the existing Java Installation. And instead installed Java 8 and this worked perfectly fine for me then.
sudo apt-get purge default-jdk
sudo apt-get autoremove
sudo apt update
sudo apt install openjdk-8-jdk openjdk-8-jre
Many thanks to you guys.
Managed to make this package to work with the version 3.2 of the Java package "Language Tool"
https://languagetool.org/download/LanguageTool-3.2.zip
Edit init.py around line 315 which in my system is ~/.local/lib/python3.6/site-packages/language_check/init.py
line 315: @classmethod def _get_root(cls, url, data=None, num_tries=2): url=url+"/Languages" for n in range(num_tries):
Adding that line seemed to get my instance to start working Let us know if that helps.
It worked for me !! thanks
Edit init.py around line 315 which in my system is ~/.local/lib/python3.6/site-packages/language_check/init.py
line 315: @classmethod def _get_root(cls, url, data=None, num_tries=2): url=url+"/Languages" for n in range(num_tries):
Adding that line seemed to get my instance to start working Let us know if that helps.
It worked for me,too. :D