Skip to content
Features
Business
Explore
Marketplace
Pricing
This repository
Sign in
or
Sign up
Watch
440
Star
5,572
Fork
2,667
matplotlib
/
matplotlib
Code
Issues
992
Pull requests
229
Projects
5
Wiki
Insights
Pulse
Graphs
Fix ImportError: No module named 'Tkinter' on Python 3
#5790
Merged
jenshnielsen
merged 1 commit into
matplotlib
:
master
from
unknown repository
Jan 4, 2016
Conversation
2
Commits
1
Files changed
1
Changes from
all commits
Commits
Show all changes
1 commit
Select commit
55b69af
Fix ImportError: No module named 'Tkinter' on Python 3
cgohlke
Jan 4, 2016
1 file
Jump to file
No files or symbols found.
+5
−1
embedding_in_tk_canvas.py
examples/user_interfaces/embedding_in_tk_canvas.py
+5
−1
Unified
Split
Show comments
View
6
examples/user_interfaces/embedding_in_tk_canvas.py
@@ -3,7 +3,11 @@
import
matplotlib
as
mpl
import
numpy
as
np
-
import
Tkinter
as
tk
+
import
sys
+
if
sys.version_info[
0
]
<
3
:
+
import
Tkinter
as
tk
+
else
:
+
import
tkinter
as
tk
import
matplotlib.backends.tkagg
as
tkagg
from
matplotlib.backends.backend_agg
import
FigureCanvasAgg
Toggle all file notes
You can't perform that action at this time.
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.