Python 2.7 已弃用,我应该删除它吗?

标签 python

Python 2.7 已弃用(不再支持),从我的计算机(运行 macOS Catalina 的 Mac)中删除它是否有意义?

最佳答案

我不会。如果您删除它,可能有一些使用它的东西会损坏。

例如,参见 this article关于在 Mac 上设置其他 Python 版本(我特别强调):

If you want a squeaky-clean system, you can remove extraneous Python installs. But, be careful! On a Mac, the operating system needs the version of Python kept at /usr/bin/python. You cannot do much to this version - and don’t try or you’ll mess up your Mac.

如果您使用 Python 进行开发,您确实应该使用 Python 3 而不是 2,但这并不是删除旧版本的理由。

一个好的经验法则(我认为对于软件一般生活来说):如果你没有把它放在那里,那么准备好在删除它时承担全部责任。


顺便说一句,虽然这与问题无关,但它是日落而不是弃用。弃用意味着不赞成某些内容,并且通常会随后将其删除(例如从 ISO C 中弃用不安全的 gets(),随后将其从标准中完全删除)。

虽然 Python 2 肯定不被认可:-),但它并没有被从任何东西中删除(至少没有被 Python 软件基金会删除)。废止只是意味着,在 2.7.18 之后,不会对其进行任何官方更改(增强功能或错误修复)。

您仍然可以使用该版本,但是,如果发现任何问题,您将不得不忍受它们,或者组织一些其他方法来修复它们(一个可能的机会)对于付费支持供应商来说,也许)。

顺便说一句,我从 FAQ related to sunsetting 中的这些问题中得到了一点笑声。 :

I didn't hear anything about this till just now. Where did you announce it? How can I make sure announcements like this don't surprise me again?

我想,考虑到这是在 2008 年首次宣布的,人们现在应该已经知道了:-)

关于Python 2.7 已弃用,我应该删除它吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61111604/

相关文章:

python - 在我的 Raspberry Pi 上找到闪存驱动器并执行给定程序的 Shell 文件

python - 导入错误 : Cannot open shared object file in Python

python - 这个程序中的 "return fibonacci... "是怎么回事?

python - 终止 PyQt 应用程序中长时间运行的 Python 命令

python - Django forloop索引操作

python - 在 Python 中使用类对函数进行分组

python - Pandas 日期功能 : Extracting Period Index information as String

python - pyplot : Plotting [Lists of [(Lists of Tuples)]]

python - 错误 : command 'i686-linux-gnu-gcc' failed with exit status 1 while installing pylibbvg

python - SQLAlchemy 多对多 AND 过滤器