python-3.x - PIP:我可以忽略错误的 Python 2.7 EOL 警告吗?
问题描述
皮普 说:
# ./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.
这个消息可能只是个玩笑,因为我的系统上安装了 Python3.5:
% python3.5
Python 3.5.2 (default, Jan 26 2021, 13:30:48)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
当然,由版本控制专家编写的 Pip足够聪明,可以注意到这一点。但是,当我尝试运行 pip 时,我不再笑了。皮普 说:
% pip
Traceback (most recent call last):
File "/usr/local/bin/pip", line 5, in <module>
from pip._internal.cli.main import main
File "/home/user/.local/lib/python2.7/site-packages/pip/_internal/cli/main.py", line 60
sys.stderr.write(f"ERROR: {exc}")
^
SyntaxError: invalid syntax
Pip——一个版本系统——肯定知道如何调用编写 Pip 本身的 Python 版本吗?到底是怎么回事?
解决方案
推荐阅读
- javascript - 函数在另一个函数中不起作用,但内部函数的代码直接在外部函数内部时起作用
- c++ - 将数据从 csv 文件放入表中的问题 [C++]
- stored-procedures - 如何阻止 Firebird 2.5 存储过程同时执行多次
- angular - AG Grid服务器端分页解决方案
- html - SVG 在 IE11 中进入下一行
- mql4 - 在 MQL4 中创建按钮数组
- dart - 如何在 Dart 中将两个 4 位块转换为 1 个字节?
- c++ - 在 C++ 中将位串写入二进制文件
- static - 不同国家的github页面
- events - C#:确定下一次点击不在一个或多个确定位置时会发生什么