使用 pipenv 运行脚本时 tkinter 的问题

问题描述

我正在尝试使用 pipenv 运行脚本,但在运行时我得到以下信息:

Traceback (most recent call last):
File "/Users/mac/scripts/test.py",line 16,in <module>
import tkinter.filedialog
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/tkinter/__init__.py",line 37,in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named '_tkinter'

我已经尝试过 pipenv install tk ,它安装成功,但我认为还有更多方法可以让 tkinter 与 pipenv 一起工作。

提前致谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)