Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tkinter error on Heroku #26

Open
ltfschoen opened this issue May 1, 2017 · 7 comments
Open

tkinter error on Heroku #26

ltfschoen opened this issue May 1, 2017 · 7 comments
Assignees
Labels

Comments

@ltfschoen
Copy link
Owner

If deploy Visualisation.py to Heroku uncommented, then import seaborn, import matplotlib.pyplot as plt each cause error:
ImportError: No module named _tkinter.

Adding to Aptfile the following does not make any difference to error:

python-tk
python3-tk
tk8.6
tk8.6-dev
tcl8.6
tcl8.6-dev
tk
tk-dev
tkinter-pypy

Importing the following extras in Visualisation.py does not make any difference to the error:

import Tkinter as tk # Python 2
import tkinter as tk # Python 3
import matplotlib
matplotlib.use('Agg')
@ltfschoen ltfschoen self-assigned this May 1, 2017
@ltfschoen ltfschoen added the bug label May 1, 2017
@andrey-berenda
Copy link

andrey-berenda commented Aug 19, 2018

I have the same probrem, how can I use matplotlib in Heroku?

1 similar comment
@rudrathegreat
Copy link

I have the same probrem, how can I use matplotlib in Heroku?

@rudrathegreat
Copy link

It works for me by doing this -

import matplotlib
matplotlib.use('Agg')

@qrq
Copy link

qrq commented Aug 3, 2020

I have the same probrem, how can I use matplotlib in Heroku?

this solution not work :
import matplotlib
matplotlib.use('Agg')

@rudrathegreat
Copy link

link to my heroku website (Requirements in requirements.txt) - https://github.com/rudrathegreat/Water-Quality-Checking-System-Web-Application

In Data/views.py, the following lines have been used -

import matplotlib
matplotlib.use('Agg')

@qrq
Copy link

qrq commented Aug 4, 2020

its work again by saving chart in sub directory :

fg='static/chart/'+str(share)[:-3]+'.png'
plt.savefig(fg, bbox_inches='tight')

@rudrathegreat
Copy link

cool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants