language_tool_python icon indicating copy to clipboard operation
language_tool_python copied to clipboard

Error

Open pepi99 opened this issue 3 years ago • 2 comments

import language_tool_python
tool = language_tool_python.LanguageTool('en-US')

Error:

Traceback (most recent call last):
  File "/Users/petar.ulev/Documents/competence-score/main.py", line 2, in <module>
    tool = language_tool_python.LanguageTool('en-US')
  File "/Users/petar.ulev/Documents/competence-score/venv/lib/python3.8/site-packages/language_tool_python/server.py", line 62, in __init__
    self._start_server_on_free_port()
  File "/Users/petar.ulev/Documents/competence-score/venv/lib/python3.8/site-packages/language_tool_python/server.py", line 238, in _start_server_on_free_port
    self._start_local_server()
  File "/Users/petar.ulev/Documents/competence-score/venv/lib/python3.8/site-packages/language_tool_python/server.py", line 248, in _start_local_server
    download_lt()
  File "/Users/petar.ulev/Documents/competence-score/venv/lib/python3.8/site-packages/language_tool_python/download_lt.py", line 144, in download_lt
    confirm_java_compatibility()
  File "/Users/petar.ulev/Documents/competence-score/venv/lib/python3.8/site-packages/language_tool_python/download_lt.py", line 77, in confirm_java_compatibility
    output = subprocess.check_output([java_path, '-version'],
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/subprocess.py", line 415, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/usr/bin/java', '-version']' returned non-zero exit status 1.

pepi99 avatar Aug 03 '22 07:08 pepi99

@pepi99 do you have java installed?

jxmorris12 avatar Aug 03 '22 16:08 jxmorris12

Enhancement: we could check for Java and throw a more user-friendly error in its absence.

jxmorris12 avatar Aug 15 '22 17:08 jxmorris12

Never mind. We do throw an error if java is installed. Something else must have gone wrong here. @pepi99 feel free to reopen with more info

jxmorris12 avatar Oct 04 '22 14:10 jxmorris12