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

NameError: name 'Canvas' is not defined #6

Closed
saurabhbidwai opened this issue Oct 26, 2018 · 4 comments
Closed

NameError: name 'Canvas' is not defined #6

saurabhbidwai opened this issue Oct 26, 2018 · 4 comments

Comments

@saurabhbidwai
Copy link

Enter choice - 1
1
<1> Calculate accuracy
<2> Recognize letter
<3> Train again
Exit

Enter choice - 2
Traceback (most recent call last):

File "", line 164, in
recognise_letter()

File "", line 115, in recognise_letter
letter_loc = get_image_src()

File "E:\Shezartech\OCR\English\Handwriting-Recognition-master\Python\painte.py", line 71, in get_image_src
init_set()

File "E:\Shezartech\OCR\English\Handwriting-Recognition-master\Python\painte.py", line 37, in init_set
w = Canvas(master, width=canvas_width, height=canvas_height + 20)

NameError: name 'Canvas' is not defined

@samkit-jain
Copy link
Owner

Have you installed all the missing dependencies? Canvas is part of Tkinter. I know I missed adding the requirements.txt file and will do that as soon as possible.

@saurabhbidwai
Copy link
Author

I think Tkinter is not available anymore so used this-

import tkinter as tk
master = tk.Tk()

@saurabhbidwai
Copy link
Author

this is working
w = tk.Canvas(master, width=canvas_width, height=canvas_height + 20)
b = tk.Button(master, text="Predict", command=call_predict)

@ravindrakush11
Copy link

I think Tkinter is not available anymore so used this-

import tkinter as tk master = tk.Tk()

Thank you it solves my problem

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

No branches or pull requests

3 participants