今天我想開始與Tkinter合作,但我遇到了一些問題。Python 3.2 (r32:88445, Mar 28 2011, 04:14:07) [GCC 4.4.5] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> from tkinter import *Traceback (most recent call last):File "<stdin>", line 1, in <module>File "/usr/local/lib/python3.2/tkinter/__init__.py", line 39, in <module>import _tkinter # If this fails your Python may not be configured for TkImportError: No module named _tkinter那么如何配置我的Python 3.2以使用Tkinter?
4 回答

四季花海
TA貢獻(xiàn)1811條經(jīng)驗 獲得超5個贊
為了pyenv在Ubuntu 16.04上使用它,我不得不:
$ sudo apt-get install python-tk python3-tk tk-dev
然后安裝我想要的Python版本:
$ pyenv install 3.6.2
然后我可以很好地導(dǎo)入tkinter:
import tkinter
添加回答
舉報
0/150
提交
取消