小编dar*_*384的帖子

弃用警告:Tk 的系统版本已弃用,Vs Code 中的 M1 Mac - 全局 Python

(M1 MBA 2020,MacOS 12.3.1)因此,在 Vs Code 内部,当我Python 3.8.9从我的解释器中选择解释器时usr/local/bin Tkinter,它会按照我想要的方式运行。

这是正在工作的口译员

这是运行代码供参考。

运行代码

当我尝试使用全局Python 3.8.9解释器(usr/bin/python3)时出现问题。当代码运行时,应用程序最终看起来像这样。

tkinter 不工作

此外,当我运行代码时,终端会读取以下内容:

DEPRECATION WARNING: The system version of Tk is deprecated and may be removed in a future release. Please don't rely on it. Set TK_SILENCE_DEPRECATION=1 to suppress this warning.
Run Code Online (Sandbox Code Playgroud)

我怎样才能修复这个错误?或者更新我的全局 Tkinter 版本而不偏离Python 3.8.9. 此外,如果需要更多信息,我很乐意提供,抱歉我对这些东西不熟悉

应用程序中使用的软件包:tkinter、Pillow、tkmacosx

最后一件事,当我删除所有提及的软件包 Tkmacosx 时,该应用程序显示如下:

没有 tkmacosx 的应用程序

python tkinter visual-studio-code

8
推荐指数
2
解决办法
3万
查看次数

标签 统计

python ×1

tkinter ×1

visual-studio-code ×1