我正在尝试探索 PySimpleGUI。按照这个链接PySimpleGUI
但当我这样做时,
import PySimpleGUI
得到错误,
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.7/site-packages/PySimpleGUI/__init__.py", line 2, in <module>
from .PySimpleGUI import *
File "/usr/local/lib/python3.7/site-packages/PySimpleGUI/PySimpleGUI.py", line 4, in <module>
import tkinter as tk
File "/usr/local/lib/python3.7/tkinter/__init__.py", line 36, in <module>
import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named '_tkinter'
我试过,
sudo apt-get install python3-tk
and
sudo apt-get install python3.7-tk
但无法摆脱上述错误。
我当前的系统详细信息:
OS - Ubuntu 19.04
python - Python 3.7.3
PySimpleGUI - 3.29.0
tcl - 8.6.9
如何解决这个问题?