python - 在 Ubuntu 中调用 py 导致 collections.abc 弃用警告

标签 python python-3.x linux ubuntu

所以,我刚刚第一次安装了 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 是最新的。

最佳答案

发现这与您的问题有关:
https://programmerah.com/solved-python3-10-error-cannot-import-name-iterable-from-collections-46165/
此外,在 Unix/Linux 中,对 Python 环境的调用是“python”而不是 py。

关于python - 在 Ubuntu 中调用 py 导致 collections.abc 弃用警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70606072/

相关文章:

python - docker 容器中显示的旧版本代码

python - 对称频谱的 iFFT

python - 在字符串中查找阿拉伯语单词字符串给出错误 'ascii'编解码器无法解码

python-3.x - 在作业 Circle Ci 中使用 Blackbox 时出现错误 "gpg: decryption failed: No secret key"

linux - 如何在linux ubuntu中安装python3线程模块

linux - eclipse NEON : generate core dump

python - 列表索引超出范围 - 但我在处理之前检查长度

python - 如何只记录某个级别名称的python日志记录

linux - 什么时候在linux中设置esp寄存器?

linux - 如何在 Linux 中使用带参数的 awk 别名?