LoginSignup
4
14

More than 3 years have passed since last update.

Python embeddableへのTkinterの導入方法

Posted at

はじめに

Pythonに標準搭載されているGUIライブラリ「Tkinter」を
Python embeddableへの導入方法に四苦八苦したので記載します。

参考:https://stackoverflow.com/questions/37710205/python-embeddable-zip-install-tkinter

環境

Windows10 64bit
Python embeddable 3.6.7
Python 3.6.9

(※Embeddable pythonとは別にPython環境が必要です。)

概要

ざっくりとした手順は
Python embeddableのフォルダにPythonのフォルダからTkinterを持ってくる
というものになります。

手順

1.Pythonフォルダより下記2フォルダを持ってくる。
・「tcl」フォルダ
(python-3.6.7-embed-amd64/tcl と配置)

・Lib配下に存在する「tkinter」フォルダ
(python-3.6.7-embed-amd64/Lib/tkinter と配置)

image.png

2.Pythonフォルダより下記3ファイルを持ってくる。
(全てpython-3.6.7-embed-amd64/DLLs 配下に格納)
・_tkinter.pyd
・tcl86t.dll
・tk86t.dll

image.png

3.python36._pthに.\DLLsを書き加える。

image.png

以上です。

4
14
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
4
14