Pythonで簡単なデスクトップアプリケーションを作成しようと思いました
ChatGPTに聞くとPython標準のGUIツールキット「Tkinter」を使うのが良いとのこと
しかし、ChatGPTに教えてもらった導入手順を試すとエラーが
$ pip install tkinter
ERROR: Could not find a version that satisfies the requirement tkinter (from versions: none)
ERROR: No matching distribution found for tkinter
ググって別のを試す
でもこっちも違う
$ pip install python-tk
ERROR: Could not find a version that satisfies the requirement python-tk (from versions: none)
ERROR: No matching distribution found for python-tk
正解は↓
$ pip3 install pytk
Collecting pytk
Downloading pytk-0.0.2.1-py2.py3-none-any.whl (20 kB)
Collecting flyingcircus (from pytk)
Downloading flyingcircus-0.1.4.1-py2.py3-none-any.whl (130 kB)
---------------------------------------- 131.0/131.0 kB 2.6 MB/s eta 0:00:00
Collecting appdirs (from flyingcircus->pytk)
Downloading appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB)
Collecting blessed (from flyingcircus->pytk)
Downloading blessed-1.20.0-py2.py3-none-any.whl (58 kB)
---------------------------------------- 58.4/58.4 kB 1.0 MB/s eta 0:00:00
--- 中略 ---
Collecting wcwidth>=0.1.4 (from blessed->flyingcircus->pytk)
Using cached wcwidth-0.2.6-py2.py3-none-any.whl (29 kB)
Collecting six>=1.9.0 (from blessed->flyingcircus->pytk)
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting jinxed>=1.1.0 (from blessed->flyingcircus->pytk)
Downloading jinxed-1.2.0-py2.py3-none-any.whl (33 kB)
Collecting packaging>=20.0 (from setuptools-scm->flyingcircus->pytk)
Downloading packaging-23.1-py3-none-any.whl (48 kB)
---------------------------------------- 48.9/48.9 kB 1.2 MB/s eta 0:00:00
Collecting typing-extensions (from setuptools-scm->flyingcircus->pytk)
Downloading typing_extensions-4.6.3-py3-none-any.whl (31 kB)
Collecting tomli>=1.0.0 (from setuptools-scm->flyingcircus->pytk)
Downloading tomli-2.0.1-py3-none-any.whl (12 kB)
Collecting ansicon (from jinxed>=1.1.0->blessed->flyingcircus->pytk)
Downloading ansicon-1.89.0-py2.py3-none-any.whl (63 kB)
---------------------------------------- 63.7/63.7 kB 1.7 MB/s eta 0:00:00
Installing collected packages: wcwidth, appdirs, ansicon, typing-extensions, tomli, six, packaging, jinxed, setuptools-scm, blessed, flyingcircus, pytk
Successfully installed ansicon-1.89.0 appdirs-1.4.4 blessed-1.20.0 flyingcircus-0.1.4.1 jinxed-1.2.0 packaging-23.1 pytk-0.0.2.1 setuptools-scm-7.1.0 six-1.16.0 tomli-2.0.1 typing-extensions-4.6.3 wcwidth-0.2.6
導入確認
python -m tkinter
以上です。