myint / language-check

Python wrapper for LanguageTool grammar checker
https://pypi.python.org/pypi/language-check
GNU Lesser General Public License v3.0
327 stars 101 forks source link

http://127.0.0.1:8081: Remote end closed connection without response #67

Open VicVer09 opened 5 years ago

VicVer09 commented 5 years ago

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

`

kinoc commented 5 years ago

+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.

skure commented 5 years ago

Got the same error, working now by adding this line url=url+"/Languages" in _get_root()

richagadgil commented 5 years ago

Hi, has anyone been able to solve this? Getting the same issue.

richagadgil commented 5 years ago

@skure can you explain a little more

kinoc commented 5 years ago

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.

tprei commented 4 years ago

@kinoc it worked perfectly thanks =)

digital-mine commented 4 years ago

@kinoc didn't work for me... Any alternative solution out there?

jxmorris12 commented 4 years ago

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!

anant-kumar-0308 commented 3 years ago

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
DykVanDyke commented 1 year ago

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

Anvi98 commented 1 year ago

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

Wen-05-coder commented 11 months ago

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