错误:包 'stomp.py' 需要不同的 Python:2.7.12 not in '>=3.6,<4.0'?

Som*_*ver 2 python 16.04

我正在尝试ElastAlert在我的 ubuntu 16.04上安装,每当我运行时,我都会遇到pip install elastalert错误。我目前正在运行 python 2.7.12。任何帮助,将不胜感激。我是新手,所以不确定我做错了什么。错误信息如下:-

    DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. 
Please upgrade your Python as Python 2.7 is no longer maintained. 
pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
    Defaulting to user installation because normal site-packages is not writeable
    Collecting elastalert
      Using cached elastalert-0.2.4.tar.gz (128 kB)
    Requirement already satisfied: apscheduler>=3.3.0 in /home/ubuntu/.local/lib/python2.7/site-packages (from elastalert) (3.6.3)
    Requirement already satisfied: aws-requests-auth>=0.3.0 in /home/ubuntu/.local/lib/python2.7/site-packages (from elastalert) (0.4.2)
    Requirement already satisfied: blist>=1.3.6 in /home/ubuntu/.local/lib/python2.7/site-packages (from elastalert) (1.3.6)
    Requirement already satisfied: boto3>=1.4.4 in /home/ubuntu/.local/lib/python2.7/site-packages (from elastalert) (1.12.28)
    Requirement already satisfied: configparser>=3.5.0 in /home/ubuntu/.local/lib/python2.7/site-packages (from elastalert) (4.0.2)
    Requirement already satisfied: croniter>=0.3.16 in /home/ubuntu/.local/lib/python2.7/site-packages (from elastalert) (0.3.31)
    Collecting elasticsearch==7.0.0
      Using cached elasticsearch-7.0.0-py2.py3-none-any.whl (80 kB)
    Requirement already satisfied: envparse>=0.2.0 in /home/ubuntu/.local/lib/python2.7/site-packages (from elastalert) (0.2.0)
    Requirement already satisfied: exotel>=0.1.3 in /home/ubuntu/.local/lib/python2.7/site-packages (from elastalert) (0.1.5)
    Collecting jira>=2.0.0
      Using cached jira-2.0.0-py2.py3-none-any.whl (57 kB)
    Collecting jsonschema>=3.0.2
      Using cached jsonschema-3.2.0-py2.py3-none-any.whl (56 kB)
    Collecting mock>=2.0.0
      Using cached mock-3.0.5-py2.py3-none-any.whl (25 kB)
    Collecting prison>=0.1.2
      Using cached prison-0.1.3-py2.py3-none-any.whl (5.8 kB)
    Requirement already satisfied: PyStaticConfiguration>=0.10.3 in /home/ubuntu/.local/lib/python2.7/site-packages (from elastalert) (0.10.4)
    Collecting python-dateutil<2.7.0,>=2.6.0
      Using cached python_dateutil-2.6.1-py2.py3-none-any.whl (194 kB)
    Requirement already satisfied: PyYAML>=3.12 in /home/ubuntu/.local/lib/python2.7/site-packages (from elastalert) (5.3.1)
    Requirement already satisfied: requests>=2.10.0 in /home/ubuntu/.local/lib/python2.7/site-packages (from elastalert) (2.23.0)
    Requirement already satisfied: stomp.py>=4.1.17 in /home/ubuntu/.local/lib/python2.7/site-packages (from elastalert) (6.0.0)
    ERROR: Package 'stomp.py' requires a different Python: 2.7.12 not in '>=3.6,<4.0'
Run Code Online (Sandbox Code Playgroud)

Dan*_* M. 5

错误比较明显。您尝试安装的软件包仅支持 Python 3.6+。

您的选择是安装更新的 python(网上有很多指南)或升级到更新的 Ubuntu LTS 版本(16.04 即将结束生命周期)。

  • 需要明确的是,Ubuntu 16.04 附带了 Python 2.7 和 Python 3.5,它们都不满足 3.6+ 的要求。 (3认同)