ModuleNotFoundError: No module named '_tkinter' while deploying Flask application

Apr 4 11:37:12 PM    File "/opt/render/project/python/Python-3.9.15/lib/python3.9/tkinter/__init__.py", line 37, in <module>
Apr 4 11:37:12 PM      import _tkinter # If this fails your Python may not be configured for Tk
Apr 4 11:37:12 PM  ModuleNotFoundError: No module named '_tkinter'

Hello guys, im trying to deploying my Flask app which part of it uses Tkinter to upload files, however I keep getting this error while deploying. May I know how to solve this?
Tried including tk in requirements.txt, but the deployment still cannot recognize the Tkinter module

Hi there,

Did you still need assistance here? I see that your most recent deploy was successful.

Best,

i’am also having same issue while deploying from django project. I tried including different python versions and also tried including tkinter module in requirements.txt file.But no use ,failed to deploy my django app. sincerely requesting for help ;(

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.