当执行
pip install paddlehub
在终端安装执行后出现以下错误内容:
Collecting shellcheck-py
Using cached shellcheck_py-0.7.2.1.tar.gz (4.2 kB)
Building wheels for collected packages: shellcheck-py
Building wheel for shellcheck-py (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-dy984vib/shellcheck-py/setup.py'"'"'; __file__='"'"'/tmp/pip-install-dy984vib/shellcheck-py/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-fkat704k
cwd: /tmp/pip-install-dy984vib/shellcheck-py/
Complete output (4 lines):
running bdist_wheel
running build
running fetch_binaries
error: <urlopen error [Errno 104] Connection reset by peer>
----------------------------------------
ERROR: Failed building wheel for shellcheck-py
Running setup.py clean for shellcheck-py
Failed to build shellcheck-py
Installing collected packages: shellcheck-py
Running setup.py install for shellcheck-py ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-dy984vib/shellcheck-py/setup.py'"'"'; __file__='"'"'/tmp/pip-install-dy984vib/shellcheck-py/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-walxj7n6/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7m/shellcheck-py
cwd: /tmp/pip-install-dy984vib/shellcheck-py/
Complete output (4 lines):
running install
running build
running fetch_binaries
error: <urlopen error [Errno 104] Connection reset by peer>
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-dy984vib/shellcheck-py/setup.py'"'"'; __file__='"'"'/tmp/pip-install-dy984vib/shellcheck-py/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-walxj7n6/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7m/shellcheck-py Check the logs for full command output.
此时登入链接 需要下载相应库的whl:
如果下载tar.gz或者whl仍然出错时(tar.gz仍然报以上错误,whl则出现平台不支持问题):
需要进入python查询pip所支持的whl(此查询法只适用于pip=20.0.1,若更低版本则需要更换查询方式) :
import pip._internal.pep425tags
print(pip._internal.pep425tags.get_supported())
如果没有支持的,更新pip之后再安装:
pip install --upgrade pip
pip install shellcheck_py-0.7.2.1-py2.py3-none-manylinux1_x86_64.whl <your whl>
pip install paddlehub
安装成功:
进入python后可以正常import,即为安装成功:
import paddlehub