0

My streamlit app run well localy (windows anaconda python 9.3.13 and is successfully deployed on heroku but failed to run online because of this error : File "/app/.heroku/python/lib/python3.9/tkinter/init.py", line 37, in import _tkinter # If this fails your Python may not be configured for Tk

I read a lot of solutions here and test them especially change python version, reinstall tkinter via anaconda, on windows without wsl I don't know how to install or reinstall tkinter with apt-get or brew ... On streamlit.share I have got the same issue and solve it with a packages.txt file with just this line libtk8.6 ... it works fine but my app run fine but I can share it because this service need to subscribe an account and it's not possible for the people who I want to share the app...

I try to add libtk8.6 in the runtime.txt file needed by heroku but it doesn't work ...

Thanks to help me ... if somebody had the same issue.

jjv75
  • 1
  • And it definitely _won't_ support Tkinter. That is a graphical toolkit that doesn't make sense to run on a web server. Why do you think you need it? I'm not familiar with Streamlit, but if it uses Tkinter it probably also supports other back-ends that might be more appropriate. – ChrisGPT was on strike Sep 22 '22 at 12:35
  • Thanks Chris for this answer. I have understand that it is matplotlib datavisualisation package which need tk but I am not a specialist ... Majority of posts I read advise to reinstall or better install tkinter but in my case it doesn't work... – jjv75 Sep 22 '22 at 12:43
  • In that case, I believe the duplicates I just provided should answer your question. – ChrisGPT was on strike Sep 22 '22 at 13:01
  • Thanks again @Chris for these duplicates. I had still read them and had add `import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt but it doesn't solve the issue. But I have no defined aptfile containing a list of required libraries ... I have not notice in the tutorials I have read that it will be mandatory ... Thanks again for your help – jjv75 Sep 22 '22 at 13:28
  • Thanks again @Chris. I have disable lines of code which refer to tkinter commenting them out, and it works. My webapp is successfully deployed on heroku without error. Thanks again ! – jjv75 Sep 24 '22 at 12:01

0 Answers0