【发布时间】:2021-04-09 23:19:41
【问题描述】:
我想使用兼容 python 2.7(但不是 3.8)的 python 脚本
我需要 pip 才能使脚本正常工作,但看起来我不能再安装 pip 了?我尝试使用 get-pip.py ,但它不起作用:
user@DESKTOP-J9T7UBF
$ get-pip.py
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.
c:\users\user\appdata\local\temp\tmp2kztqk\pip.zip\pip\_vendor\urllib3\util\ssl_.py:387: SNIMissingWarning: An HTTPS request has been made, but the SNI (Server Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
【问题讨论】:
-
Python 2.x 已关闭,自 2021 年 1 月 1 日起不再支持和继续
-
是的,我知道,但没有办法继续使用仅与 2.7 兼容的脚本?
-
真的是all的输出吗?最后一行是警告,而不是错误。
-
你可以降级你的 pip 并以这种方式安装包
-
最好切换到Python 3。尝试docs.python.org/3/library/2to3.html转换。