gpt4 book ai didi

python - 导入错误 : cannot import name suppress

转载 作者:太空宇宙 更新时间:2023-11-04 08:06:29 25 4
gpt4 key购买 nike

我正在尝试安装 Taiga在我的电脑上,对于其中一个脚本,它试图 import suppress 但失败了。我尝试手动执行此操作:

(taiga)$ python
Python 3.3.3 (default, Nov 27 2013, 17:12:35)
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from contextlib import suppress
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name suppress

有人可以帮忙吗?

最佳答案

根据documentation for Taiga ,其中的要求是:

Python 3.4

因此,您不应该期望它能在 Python 3.3 中运行。

这正是您的问题所在。 contextlib.suppress功能是“版本 3.4 中的新功能”。

关于python - 导入错误 : cannot import name suppress,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30427549/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com