Python 2.7安装gunicorn错误requires a different Python: 2.7.5 not in ‘>=3.4’
在centos 7中使用Python 2.7使用pip安装gunicorn提示“requires a different Python: 2.7.5 not in ‘>=3.4’”错误怎么办?
[root@iZj6cjbi6qgcpn0aeo4u6dZ supply]# pip install gunicorn 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 pip 21.0 will remove support for this functionality. Looking in indexes: http://mirrors.cloud.aliyuncs.com/pypi/simple/ Collecting gunicorn Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/69/ca/926f7cd3a2014b16870086b2d0fdc84a9e49473c68a8dff8b57f7c156f43/gunicorn-20.0.4-py2.py3-none-any.whl (77 kB) |████████████████████████████████| 77 kB 34.8 MB/s ERROR: Package 'gunicorn' requires a different Python: 2.7.5 not in '>=3.4'
因为错误原因在于不指定版本就会安装最新的版本的,目前我使用的python2.7。
pip怎么查看软件包有哪些版本?随便写个版本号,会提示错误提示。
看来上面的数字,我安装了一个较中间的版本,正常。
[root@iZj6cjbi6qgcpn0aeo4u6dZ supply]# pip install gunicorn==0.14.0 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 pip 21.0 will remove support for this functionality. Looking in indexes: http://mirrors.cloud.aliyuncs.com/pypi/simple/ Collecting gunicorn==0.14.0 Downloading http://mirrors.cloud.aliyuncs.com/pypi/packages/ec/cf/5deb43f429e0918cfd0ddbc67d42acb8c909925f595cb2fca447df3ba242/gunicorn-0.14.0.tar.gz (203 kB) |████████████████████████████████| 203 kB 915 kB/s Using legacy 'setup.py install' for gunicorn, since package 'wheel' is not installed. Installing collected packages: gunicorn Running setup.py install for gunicorn … done Successfully installed gunicorn-0.14.0