Pip安装错误,Pyconstrations'错误:命令出错,退出状态为1:'

2024-05-19 07:43:04 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试安装PyCompressions,但它失败了,错误如下,您知道如何修复吗

我试过康达,但它没有这个包

pip安装收缩

➜  ~ pip install pycontractions
Collecting pycontractions
  Using cached pycontractions-2.0.1-py3-none-any.whl (9.6 kB)
Requirement already satisfied: pyemd>=0.4.4 in ./anaconda3/lib/python3.8/site-packages (from pycontractions) (0.5.1)
Requirement already satisfied: gensim>=2.0 in ./anaconda3/lib/python3.8/site-packages (from pycontractions) (3.8.3)
Collecting language-check>=1.0
  Using cached language-check-1.1.tar.gz (33 kB)
Requirement already satisfied: six>=1.5.0 in ./anaconda3/lib/python3.8/site-packages (from gensim>=2.0->pycontractions) (1.15.0)
Requirement already satisfied: scipy>=0.18.1 in ./anaconda3/lib/python3.8/site-packages (from gensim>=2.0->pycontractions) (1.6.0)
Requirement already satisfied: smart-open>=1.8.1 in ./anaconda3/lib/python3.8/site-packages (from gensim>=2.0->pycontractions) (4.0.1)
Requirement already satisfied: numpy>=1.11.3 in ./anaconda3/lib/python3.8/site-packages (from gensim>=2.0->pycontractions) (1.19.5)
Building wheels for collected packages: language-check
  Building wheel for language-check (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/chandanmalla/anaconda3/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-bfmnwlkb/language-check_f69d4d9b5ed64600bceefdb6cc11cab8/setup.py'"'"'; __file__='"'"'/tmp/pip-install-bfmnwlkb/language-check_f69d4d9b5ed64600bceefdb6cc11cab8/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/pip-wheel-799tz281
       cwd: /tmp/pip-install-bfmnwlkb/language-check_f69d4d9b5ed64600bceefdb6cc11cab8/
  Complete output (4 lines):
  Could not parse Java version from """openjdk version "11.0.9.1" 2020-11-04
  OpenJDK Runtime Environment (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.10)
  OpenJDK 64-Bit Server VM (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.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, pycontractions
    Running setup.py install for language-check ... error
    ERROR: Command errored out with exit status 1:
     command: /home/chandanmalla/anaconda3/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-bfmnwlkb/language-check_f69d4d9b5ed64600bceefdb6cc11cab8/setup.py'"'"'; __file__='"'"'/tmp/pip-install-bfmnwlkb/language-check_f69d4d9b5ed64600bceefdb6cc11cab8/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-record-whpzc2so/install-record.txt --single-version-externally-managed --compile --install-headers /home/chandanmalla/anaconda3/include/python3.8/language-check
         cwd: /tmp/pip-install-bfmnwlkb/language-check_f69d4d9b5ed64600bceefdb6cc11cab8/
    Complete output (4 lines):
    Could not parse Java version from """openjdk version "11.0.9.1" 2020-11-04
    OpenJDK Runtime Environment (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.10)
    OpenJDK 64-Bit Server VM (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.10, mixed mode)
    """.
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/chandanmalla/anaconda3/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-bfmnwlkb/language-check_f69d4d9b5ed64600bceefdb6cc11cab8/setup.py'"'"'; __file__='"'"'/tmp/pip-install-bfmnwlkb/language-check_f69d4d9b5ed64600bceefdb6cc11cab8/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-record-whpzc2so/install-record.txt --single-version-externally-managed --compile --install-headers /home/chandanmalla/anaconda3/include/python3.8/language-check Check the logs for full command output.

Tags: installpipfrompypackageschecksetupopen
1条回答
网友
1楼 · 发布于 2024-05-19 07:43:04

pycontractions依赖于language-check,而language-check的安装需要一个特定的java版本,因为它没有正确地确定版本并失败

您可以尝试安装jdk8,并将其设置为默认java程序,但由于它非常旧,而且我们已经使用java15,因此您在这样做时也可能会遇到问题

假设您正在使用某种Debian/Ubuntu,您可以尝试:

sudo apt install openjdk-8-jdk
sudo update-alternatives  set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
pip install language-check
pip install pycontractions

language-check Github Issue

pycontractions Github Issue

pycontractions Github Issue II

相关问题 更多 >

    热门问题