myint / language-check

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

pip install fails #59

Open luxe opened 6 years ago

luxe commented 6 years ago
pip install language-check                                                                                                                                          1
Collecting language-check
  Using cached https://files.pythonhosted.org/packages/97/45/0fd1d3683d6129f30fa09143fa383cdf6dff8bc0d1648f2cf156109cb772/language-check-1.1.tar.gz
Building wheels for collected packages: language-check
  Running setup.py bdist_wheel for language-check ... error
  Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-_W9osa/language-check/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpYOwq7gpip-wheel- --python-tag cp27:
  Could not parse Java version from """openjdk version "10.0.1" 2018-04-17
  OpenJDK Runtime Environment (build 10.0.1+10-Ubuntu-3ubuntu1)
  OpenJDK 64-Bit Server VM (build 10.0.1+10-Ubuntu-3ubuntu1, mixed mode)
  """.

  ----------------------------------------
  Failed building wheel for language-check
  Running setup.py clean for language-check
Failed to build language-check
Installing collected packages: language-check
  Running setup.py install for language-check ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-_W9osa/language-check/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-xKEHYl-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:
    Could not parse Java version from """openjdk version "10.0.1" 2018-04-17
    OpenJDK Runtime Environment (build 10.0.1+10-Ubuntu-3ubuntu1)
    OpenJDK 64-Bit Server VM (build 10.0.1+10-Ubuntu-3ubuntu1, mixed mode)
    """.

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-_W9osa/language-check/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-xKEHYl-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-_W9osa/language-check/
Bachstelze commented 6 years ago

There is a wrong regex for parsing the java version. There are also already 3 pull requests to fix it, but the maintainers are too lazy to merge it.

zachsamuels commented 5 years ago

I am having this same issue, please fix it.

rkwojdan commented 5 years ago

We had the same problem and uninstalling java 10 and next installing java 8 solved the issue. Hope it will you, as well.

pratik1998 commented 5 years ago

Error arises due to wrong version of openjdk. I installed oracle java 8 by following instructions from this. Now everything works fine.

kallewesterling commented 5 years ago

Same error happening now. I just encountered it through the py-contractions package that relies on language-check. (See issue here.)

nourel commented 5 years ago

Same error happening now. I just encountered it through the py-contractions package that relies on language-check. (See issue here.)

same issue here. We getting this fixed soon ?

Bachstelze commented 5 years ago

Try to install it from this source. There isn't yet a version on pip with this bug fix.

KorayTugberk-g commented 4 years ago

I still can't download this package....

SouravMalliK commented 3 years ago

Hi, How you use language tool in Google Cloud Function? I'm trying to deploy in GCP Cloud Function with runtime Python 3.7. I could use the library using my local virtual environment where I have java installed. But when I'm trying to deploy it in Cloud Function.. I'm getting the following error message --

Function failed on loading user code. Error message: Code in file main.py can't be loaded. Did you list all required modules in requirements.txt? Detailed stack trace: Traceback (most recent call last): File "/env/local/lib/python3.7/site-packages/google/cloud/functions/worker_v2.py", line 359, in check_or_load_user_function _function_handler.load_user_function() File "/env/local/lib/python3.7/site-packages/google/cloud/functions/worker_v2.py", line 236, in load_user_function spec.loader.exec_module(main_module) File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/user_code/main.py", line 10, in <module> from libraries.unknown_word import word_meaning File "/user_code/libraries/unknown_word.py", line 18, in <module> tool = language_tool_python.LanguageTool('en-IN') File "/env/local/lib/python3.7/site-packages/language_tool_python/server.py", line 46, in __init__ self._start_server_on_free_port() File "/env/local/lib/python3.7/site-packages/language_tool_python/server.py", line 183, in _start_server_on_free_port self._start_local_server() File "/env/local/lib/python3.7/site-packages/language_tool_python/server.py", line 193, in _start_local_server download_lt() File "/env/local/lib/python3.7/site-packages/language_tool_python/download_lt.py", line 144, in download_lt confirm_java_compatibility() File "/env/local/lib/python3.7/site-packages/language_tool_python/download_lt.py", line 75, in confirm_java_compatibility raise ModuleNotFoundError('No java install detected. Please install java to use language-tool-python.') ModuleNotFoundError: No java install detected. Please install java to use language-tool-python.

Can you please provide a solution to use LanguageTool from server less functions? How can we have java environment in Cloud Function along with Python 3.7?

BR.

MCFreddie777 commented 3 years ago

Any progress on this?

willnaoosmith commented 3 years ago

Same here

katkaypettitt commented 3 years ago

I am also having this issue, except I have java 15.0.1 installed. Would be nice to see an update.

WarleiAlves commented 3 years ago

I suggest you try to install version 6 or 8 of the JDK. I've already figured out how to install with JDK 11, but after that the package doesn't work, throwing the following exception in Java:

language_check.Error: Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException

I found that the error is caused by some changes in the java libraries after version 8.

TejaswitaW commented 2 years ago

I tried with 6,7,8 of the jdk, but still getting same error.