Hi, I try to import matplotlib.pyplot from python shell in QGIS (2.18 or 2.99). It imports OK if I run it from QGIS internal python shell but it fails if I run it from python outside QGIS (running python via OSGeo4W.bat).
it might have something to do with Tkinter. code examples: 1. import matplotlib dir(matplotlib) -> yields a shorter list (laking pyplot among others) if run from outside QGIS. 2. import matplotlib.pyplot as plt -> Success from QGIS, but gives the following error if run from outside. Traceback (most recent call last): File "<stdin>", line 1, in <module> File "c:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\matplotlib\pyplot.py", line 115, in <module> _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup() File "c:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\matplotlib\backends\__init__.py", line 32, in pylab_setup globals(),locals(),[backend_name],0) File "c:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\matplotlib\backends\backend_tkagg.py", line 6, in <module> from six.moves import tkinter as Tk File "c:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\six.py", line 203, in load_module mod = mod._resolve() File "c:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\six.py", line 115, in _resolve return _import_module(self.mod) File "c:\PROGRA~1\QGIS2~1.18\apps\Python27\lib\site-packages\six.py", line 82, in _import_module __import__(name) ImportError: No module named Tkinter Thanks, Idan
_______________________________________________ QGIS-Developer mailing list QGIS-Developer@lists.osgeo.org List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer