Visit the Community Forum to learn more and ask any questions you have!

module tkinter not found

Back to Thread List

Hello, during the deployment of the application after adjusting the requirements.txt file I encounter the error "ModuleNotFoundError: No module named 'tkinter'", it happens that in my forms.py files I use this with the import "from tkinter import Widget" to manage the app's forms.

Could you tell me if I missed a step or what I should do?

by jhoan.11valencia on Jan. 21, 2025, 2:23 a.m.

Replies

  • Hi, sorry to hear you're having trouble!

    I took a look at your project and requirements.txt but did not see tk listed in the file. I believe the package should be named "tk" in requirements.txt but did not see it there. Can you try adding it there and clicking the Deploy button again?

    by zach on Jan. 21, 2025, 1:32 p.m.
  • Hi, from what I've researched tkinter is a python package, not a django package, so it won't take it in requirements.txt, in fact it makes it stop working. Basically the python instance that the system is using must have tkinter installed, we would need to do an 'apt-get install python3-tk', I don't know if it's possible.

    by jhoan.11valencia on Jan. 21, 2025, 10:02 p.m.
Reply to this thread