首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Pip install error with pycontractions 'ERROR: Command ERROR out with exit status 1:‘

Pip install error with pycontractions 'ERROR: Command ERROR out with exit status 1:‘
EN

Stack Overflow用户
提问于 2021-02-27 00:21:07
回答 1查看 581关注 0票数 0

我正在尝试安装pycontractions,但它失败了,错误如下,你知道如何修复这个问题吗?

我试着使用conda,但它没有这个包

pip安装pycontractions

代码语言:javascript
复制
➜  ~ 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.
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-02-27 00:34:52

pycontractions依赖于language-check,而language-check的安装需要一个特定的java版本,因为它不能正确确定版本,因此会失败。

您可以尝试安装jdk8并将其设置为默认的java程序,但是由于它已经很旧了,而且我们已经使用了java15,所以这样做也可能会遇到问题。

假设你使用的是某种Debian/Ubuntu,你可以试试:

代码语言:javascript
复制
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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66389354

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档