python-3.x 使用pip install安装语言检查时出错

j8yoct9x  于 2022-12-01  发布在  Python
关注(0)|答案(2)|浏览(179)

当我使用pip的时候,我在安装语言检查的时候遇到了一个错误。我的python版本是3.9.5。
我试过把这些命令放进powershell以及一些更多的,他们都给了我同样的错误。我不知道如何继续

pip install language-check
pip install language_check
pip install --upgrade language-check
pip install --upgrade language-check

我收到的错误

PS D:\Python> pip install --upgrade language-check
Collecting language-check
  Using cached language-check-1.1.tar.gz (33 kB)
Building wheels for collected packages: language-check
  Building wheel for language-check (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: 'd:\python\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\rodge\\AppData\\Local\\Temp\\pip-install-q4dwn2qj\\language-check_ee739d071d0c47e9b1b2023e1ac3ecda\\setup.py'"'"'; __file__='"'"'C:\\Users\\rodge\\AppData\\Local\\Temp\\pip-install-q4dwn2qj\\language-check_ee739d071d0c47e9b1b2023e1ac3ecda\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\rodge\AppData\Local\Temp\pip-wheel-t0bpvet6'
       cwd: C:\Users\rodge\AppData\Local\Temp\pip-install-q4dwn2qj\language-check_ee739d071d0c47e9b1b2023e1ac3ecda\
  Complete output (4 lines):
  Could not parse Java version from """openjdk version "11.0.8" 2020-07-14
  OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.8+10)
  OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.8+10, mixed mode)
  """.
  ----------------------------------------
  ERROR: 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
    ERROR: Command errored out with exit status 1:
     command: 'd:\python\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\rodge\\AppData\\Local\\Temp\\pip-install-q4dwn2qj\\language-check_ee739d071d0c47e9b1b2023e1ac3ecda\\setup.py'"'"'; __file__='"'"'C:\\Users\\rodge\\AppData\\Local\\Temp\\pip-install-q4dwn2qj\\language-check_ee739d071d0c47e9b1b2023e1ac3ecda\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\rodge\AppData\Local\Temp\pip-record-52viif_0\install-record.txt' --single-version-externally-managed --compile --install-headers 'd:\python\Include\language-check'
         cwd: C:\Users\rodge\AppData\Local\Temp\pip-install-q4dwn2qj\language-check_ee739d071d0c47e9b1b2023e1ac3ecda\
    Complete output (4 lines):
    Could not parse Java version from """openjdk version "11.0.8" 2020-07-14
    OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.8+10)
    OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.8+10, mixed mode)
    """.
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'd:\python\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\rodge\\AppData\\Local\\Temp\\pip-install-q4dwn2qj\\language-check_ee739d071d0c47e9b1b2023e1ac3ecda\\setup.py'"'"'; __file__='"'"'C:\\Users\\rodge\\AppData\\Local\\Temp\\pip-install-q4dwn2qj\\language-check_ee739d071d0c47e9b1b2023e1ac3ecda\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\rodge\AppData\Local\Temp\pip-record-52viif_0\install-record.txt' --single-version-externally-managed --compile --install-headers 'd:\python\Include\language-check' Check the logs for full command output.
cbeh67ev

cbeh67ev1#

这似乎是一个old known bug。包似乎被放弃了,最后一次提交是在2019年2月16日。
该包被派生、更新并以名称language-tool-python发布:https://pypi.org/project/language-tool-python/
尝试

pip install language-tool-python
fivyi3re

fivyi3re2#

到目前为止,这是language-checkgit repo上的已知和open issue。它是由Java版本的错误正则表达式引起的,并且是由JDK版本〉= 8引起的
要解决这个问题,您可以尝试使用@phd提到的派生项目,或者
您可以卸载JDK 11并改为安装JDK 6。

相关问题