0
0

python初心者です。

Posted at

tkinterを使ったプログラミング練習でエラーが出てしまいます。何故でしょうか?ご教授願います。

実行環境 linux mint 21.3
開発言語 python3.9
エディタ VSCODE

実行コード

import tkinter as tk

#メインウィンドウ
root = tk.TK()
#タイトル
root.title("初めてのtkiner")
#ウィンドウサイズ
root.geometry(400*100)
#ラベル
label1 =tk.Label(root,text="Pythonの世界へようこそ",bg="yellow",fg="green")
label1.pack()
label2 =tk.Label(root,text="Pythonはオブジェクト指向", bg="orange")
label2.pack()
label3 = tk.Label(root,text="tkinterでGUIアプリ",bg="pink")
lable3.pack()

#メインループ
root.mainloop()

エラーコード
/bin/python3 /home/os/python/tkinter1.py
Traceback (most recent call last):
File "/home/os/python/tkinter1.py", line 1, in
import tkinter as tk
ModuleNotFoundError: No module named 'tkinter

0
0
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0