0

我正在尝试使用将 Nagios LogServer 安装到原始 CentOS 7.2.1511

curl https://assets.nagios.com/downloads/nagios-log-server/install.sh | sh

我收到这个初始错误

Downloading https://files.pythonhosted.org/packages/21/83/308a74ca1104fe1e3197d31693a7a2db67c2d4e668f20f43a2fca491f9f7/click-8.0.1.tar.gz (327kB)
    Complete output from command python setup.py egg_info:
    error in click setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-fy2L78/click/
You are using pip version 8.1.2, however version 21.1.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

然后运行

pip install --upgrade pip

并重新运行安装,得到

Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    load_entry_point('pip==21.1.3', 'console_scripts', 'pip')()
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 378, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2566, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2260, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python2.7/site-packages/pip/__init__.py", line 1, in <module>
    from typing import List, Optional
ImportError: No module named typing

我尝试了多种解决方案,例如,重新模板化服务器、安装python 2.7、运行pip install typing然后运行安装。这导致

 Complete output from command python setup.py egg_info:
    error in click setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers

并提示更新点子。在安装之前或之后升级 pip 会导致

Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    load_entry_point('pip==21.1.3', 'console_scripts', 'pip')()
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 378, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2566, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2260, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/lib/python2.7/site-packages/pip/_internal/cli/main.py", line 58
    sys.stderr.write(f"ERROR: {exc}")
                                   ^
SyntaxError: invalid syntax
4

0 回答 0