[osgeo4w-dev] [osgeo4w] #569: No module named Tkinter when importing matplotlib

OSGeo4W trac_osgeo4w at osgeo.org
Thu Apr 19 00:33:39 PDT 2018

#569: No module named Tkinter when importing matplotlib
Reporter:  chau    |      Owner:  osgeo4w-dev@…
    Type:  defect  |     Status:  new
Priority:  major   |  Component:  Package
 Version:          |   Keywords:
 I am trying to make the following import in python 2.7.5 from OSGeo (x64):

 {{{import matplotlib.pyplot as plt}}}

 and I get the following error report:

 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "C:\OSGEO4~1\apps\Python27\lib\site-packages\matplotlib\pyplot.py",
 line 115, in <module>
     _backend_mod, new_figure_manager, draw_if_interactive, _show =
   File "C:\OSGEO4~1\apps\Python27\lib\site-
 packages\matplotlib\backends\__init__.py", line 32, in pylab_setup
   File "C:\OSGEO4~1\apps\Python27\lib\site-
 packages\matplotlib\backends\backend_tkagg.py", line 6, in <module>
     from six.moves import tkinter as Tk
   File "C:\OSGEO4~1\apps\Python27\lib\site-packages\six.py", line 203, in
     mod = mod._resolve()
   File "C:\OSGEO4~1\apps\Python27\lib\site-packages\six.py", line 115, in
     return _import_module(self.mod)
   File "C:\OSGEO4~1\apps\Python27\lib\site-packages\six.py", line 82, in
 ImportError: No module named Tkinter

 I cannot find any {{{Tkinter}}} package in the OSGeo setup package browser
 and normally OSGeo is really good at including dependencies.

 My system is Windows 10.

Ticket URL: <https://trac.osgeo.org/osgeo4w/ticket/569>
OSGeo4W <http://trac.osgeo.org/osgeo4w>
OSGeo4W is the Windows installer and package environment for the OSGeo stack.

More information about the osgeo4w-dev mailing list