16.04 - ERROR: Package 'stomp.py' requires a different Python: 2.7.12 not in '>=3.6,<4.0'?

分享于 

4分钟阅读

ubuntu

  繁體

问题:

我尝试在ubuntu 16.04上安装ElastAlert,当运行pip install elastalert时,我一直运行到一个错误,错误信息如下: -


 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'




答案1:

错误相当清楚,你尝试安装的包仅支持Python3.6+。


答案2:

看起来你以某种方式安装了新版本的stomp.py(6.0.0 ),它与python 2不兼容,它只支持版本4.x.x


pip install --upgrade pip


pip install --upgrade setuptools


pip uninstall stomp.py


pip install elastalert




apt install python3-pip


pip3 install elastalert





PAC  PACK  Require  requires