私は私のドッカーの画像で私のpythonスクリプトを実行すると、このエラーが表示されます
ImportError: No module named _tkinter, please install the python-tk package
だから私は "python-tkをインストールするpip"
root@43d2222b15c8:/tf_files# pip install python-tk
Collecting python-tk
Could not find a version that satisfies the requirement python-tk (from versions: )
No matching distribution found for python-tk
しかし、それは私の問題を解決しません。
問題を解決するにはどうすればいいですか?
ありがとうございました。
回答:
回答№1は0つかいます import Tkinter
。それはピップを介して要求されるべきではありません。 これはpython2.7に組み込まれています(python2.7を使用していると仮定します.3を使用している場合、これは別の解決策であり、コメント内の人々は参照しています)。
https://docs.python.org/2/library/tkinter.html#module-Tkinter