How to install python-tk to my docker image

I am getting this error when I run my python script in my docker image

ImportError: No module named _tkinter, please install the python-tk package

      

So I tried 'pip install python-tk'

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

      

But that doesn't fix my problem.

Could you please tell me how can I fix my problem?

Thank.

+3


source to share


1 answer


Use import Tkinter

. It shouldn't be required via pip. It is built into python2.7 (Assuming you are using python2.7 as this post tagged it.If you are using 3 then this is a different solution and that is what people comments are linking to.)



https://docs.python.org/2/library/tkinter.html#module-Tkinter

0


source







All Articles