【问题标题】:Calling py in Ubuntu leading to collections.abc Deprecation Warning在 Ubuntu 中调用 py 导致 collections.abc 弃用警告
【发布时间】:2022-01-06 10:58:06
【问题描述】:

所以,我刚刚安装了 Ubuntu,并尝试运行一个非常简单的 Python 项目。第一次运行时,我收到了 collections.abc 弃用警告,提示我确保我的项目是最新的。

经过进一步调查,我发现仅运行 py 命令会导致此弃用警告,如下所示:

Documents$ py

/usr/bin/py:16: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
  from collections import Iterable

有什么办法可以解决这个问题吗?我已经从系统中删除了 Python 2,并确保 Python 3 是最新的。

【问题讨论】:

    标签: python python-3.x linux ubuntu


    【解决方案1】:

    发现这与您的问题有关: https://programmerah.com/solved-python3-10-error-cannot-import-name-iterable-from-collections-46165/

    另外,在 Unix/Linux 中,对 Python 环境的调用是“python”而不是 py。

    【讨论】:

    • 请在您的回答中分享链接中的要点
    猜你喜欢
    • 2016-09-24
    • 1970-01-01
    • 1970-01-01
    • 2022-10-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多