官网python下载失败原因_按照官方文档执行到第三步时python-gssapi无法正常安装报错...

曾山
2023-12-01

[问题描述]

系统环境

Centos7.7 1908 64位

2核4G 自建虚拟主机

Python3.6 以及对应的 devel 库 都已安装好

setuptools与pip 已是最新

问题

按照官方的极速文档下执行到第三步时python-gssapi无法正常安装报错

[使用版本]

版本为 jumpserver 1.5.2

[问题复现步骤]

使用急速安装方法(参考文档 )

第一步 防火墙 Selinux 设置 正常

第二步 部署环境 正常

第三步 下载组件 当执行到python包的安装时出现异常

如上操作在重新安装的系统里(centos7.7 1908 64位)也会100%复现

[具体表现]

ERROR: Command errored out with exit status 1:

command: /opt/py3/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-atuq5e8r/python-gssapi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-atuq5e8r/python-gssapi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-atuq5e8r/python-gssapi/pip-egg-info

cwd: /tmp/pip-install-atuq5e8r/python-gssapi/

Complete output (47 lines):

WARNING: The wheel package is not available.

WARNING: The wheel package is not available.

WARNING: The wheel package is not available.

WARNING: The wheel package is not available.

ERROR: Command errored out with exit status 1:

command: /opt/py3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-wheel-0k_8zqv1/pycparser/setup.py'"'"'; __file__='"'"'/tmp/pip-wheel-0k_8zqv1/pycparser/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-39opi5ie

cwd: /tmp/pip-wheel-0k_8zqv1/pycparser/

Complete output (6 lines):

usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]

or: setup.py --help [cmd1 cmd2 ...]

or: setup.py --help-commands

or: setup.py cmd --help

error: invalid command 'bdist_wheel'

----------------------------------------

ERROR: Failed building wheel for pycparser

ERROR: Failed to build one or more wheels

Traceback (most recent call last):

File "/opt/py3/lib64/python3.6/site-packages/setuptools/installer.py", line 119, in fetch_build_egg

subprocess.check_call(cmd)

File "/usr/lib64/python3.6/subprocess.py", line 311, in check_call

raise CalledProcessError(retcode, cmd)

subprocess.CalledProcessError: Command '['/opt/py3/bin/python', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpb21n5qvj', '--quiet', '--index-url', 'https://mirrors.aliyun.com/pypi/simple/', 'pycparser']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "", line 1, in

File "/tmp/pip-install-atuq5e8r/python-gssapi/setup.py", line 74, in

url="https://github.com/sigmaris/python-gssapi",

File "/opt/py3/lib64/python3.6/site-packages/setuptools/__init__.py", line 144, in setup

_install_setup_requires(attrs)

File "/opt/py3/lib64/python3.6/site-packages/setuptools/__init__.py", line 139, in _install_setup_requires

dist.fetch_build_eggs(dist.setup_requires)

File "/opt/py3/lib64/python3.6/site-packages/setuptools/dist.py", line 721, in fetch_build_eggs

replace_conflicting=True,

File "/opt/py3/lib64/python3.6/site-packages/pkg_resources/__init__.py", line 782, in resolve

replace_conflicting=replace_conflicting

File "/opt/py3/lib64/python3.6/site-packages/pkg_resources/__init__.py", line 1065, in best_match

return self.obtain(req, installer)

File "/opt/py3/lib64/python3.6/site-packages/pkg_resources/__init__.py", line 1077, in obtain

return installer(requirement)

File "/opt/py3/lib64/python3.6/site-packages/setuptools/dist.py", line 777, in fetch_build_egg

return fetch_build_egg(self, req)

File "/opt/py3/lib64/python3.6/site-packages/setuptools/installer.py", line 121, in fetch_build_egg

raise DistutilsError(str(e))

distutils.errors.DistutilsError: Command '['/opt/py3/bin/python', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmpb21n5qvj', '--quiet', '--index-url', 'https://mirrors.aliyun.com/pypi/simple/', 'pycparser']' returned non-zero exit status 1.

----------------------------------------

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

[其他]

参考过以下issue仍然无法解决:

#873 python3.6.4 环境安装报错

#2677 请教下安装正确姿势,这也太难装了把,ubuntu装不上centos7 也装不上

#2830 离线安装时无法安装python-gssapi和python-keycloak-client waiting for feedback

#3176 1.5.2安装报错

#3194 安装依赖的时候在python-gssapi一直报错

[目前的解决方法]

注释py的问题包,从官网下载好python-gssapi包手动安装

vim /opt/jumpserver/requirements/requirements.txt

注释掉 python-gssapi==0.6.4 这行

手动执行pip install -r /opt/jumpserver/requirements/requirements.txt -i https://mirrors.aliyun.com/pypi/simple/

手动安装 python-gssapi, 执行 pip install ./python-gssapi-0.6.4.tar.gz

按上述步骤操作后余下的命令都可以正常执行,同时系统也可以正常启动

[注:] 完成后请关闭 issue

 类似资料: