TUFLOW-Support / QGIS-TUFLOW-Plugin

TUFLOW related QGIS Plugins
9 stars 7 forks source link

QGIS 3.0 - "ModuleNotFoundError: No module named 'tkinter' " #8

Closed Dan-Knott closed 6 years ago

Dan-Knott commented 6 years ago

Hi team,

The tuflow plugin doesn't appear to be working in QGIS 3.0.3. Just wondering if anyone else has been having this issue.

Error message:

Couldn't load plugin 'tuflow' due to an error when calling its classFactory() method

ModuleNotFoundError: No module named 'tkinter' Traceback (most recent call last): File "C:/PROGRA~1/QGIS3~1.0/apps/qgis/./python\qgis\utils.py", line 336, in startPlugin plugins[packageName] = package.classFactory(iface) File "C:/Users/danie/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\tuflow__init.py", line 51, in classFactory from .tuflowqgis_menu import tuflowqgis_menu File "C:/PROGRA~1/QGIS3~1.0/apps/qgis/./python\qgis\utils.py", line 664, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "C:/Users/danie/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\tuflow\tuflowqgis_menu.py", line 38, in from tuflowqgis_TuPlot import * File "C:/PROGRA~1/QGIS3~1.0/apps/qgis/./python\qgis\utils.py", line 664, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "C:\Users\danie\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\tuflow\tuflowqgis_TuPlot.py", line 11, in import matplotlib.pyplot as plt File "C:/PROGRA~1/QGIS3~1.0/apps/qgis/./python\qgis\utils.py", line 664, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "C:\PROGRA~1\QGIS3~1.0\apps\Python36\lib\site-packages\matplotlib\pyplot.py", line 115, in _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup() File "C:\PROGRA~1\QGIS3~1.0\apps\Python36\lib\site-packages\matplotlib\backends__init__.py", line 32, in pylab_setup globals(),locals(),[backend_name],0) File "C:/PROGRA~1/QGIS3~1.0/apps/qgis/./python\qgis\utils.py", line 664, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "C:\PROGRA~1\QGIS3~1.0\apps\Python36\lib\site-packages\matplotlib\backends\backend_tkagg.py", line 6, in from six.moves import tkinter as Tk File "C:/PROGRA~1/QGIS3~1.0/apps/qgis/./python\qgis\utils.py", line 664, in _import mod = _builtin_import(name, globals, locals, fromlist, level) File "C:\Users\danie\AppData\Roaming\Python\Python36\site-packages\six.py", line 92, in get result = self._resolve() File "C:\Users\danie\AppData\Roaming\Python\Python36\site-packages\six.py", line 115, in _resolve return _import_module(self.mod) File "C:\Users\danie\AppData\Roaming\Python\Python36\site-packages\six.py", line 82, in _import_module import__(name) File "C:/PROGRA~1/QGIS3~1.0/apps/qgis/./python\qgis\utils.py", line 664, in _import mod = _builtin_import(name, globals, locals, fromlist, level) ModuleNotFoundError: No module named 'tkinter'

Python version: 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)] QGIS version: 3.0.3-Girona Girona, 8a899c8758

TUFLOW-Support commented 6 years ago

Hi Dan, are you installing QGIS 3 through osgeo4w or through the stand-alone installer?

Dan-Knott commented 6 years ago

Through the stand-alone installer

TUFLOW-Support commented 6 years ago

Just to narrow down what is causing the problem, does it error when you type the following into the QGIS 3 python console?

import matplotlib.pyplot as plt

capture

Dan-Knott commented 6 years ago

yeah that throws an error: image

Dan-Knott commented 6 years ago

I think I've resolved my issue. I had a freshly installed computer to test it out on and found that the issue is being caused by an interaction with another plugin: "Data Analysis and Visualization" https://bitbucket.org/iaborsi/dataexplorer/src

The 'tuflow' crash only happens when QGIS is restarted after installing/enabling this plugin.

While it's an easy fix to just turn off the other plugin, there might be a few more out there that will cause the same issue.

TUFLOW-Support commented 6 years ago

Thanks Dan. It's definitely not ideal that this is happening. I'll try correct this.

Cheers, Ellis.

TUFLOW-Support commented 6 years ago

Hey Dan, just to let you know I've now fixed this and the fix will be included in the next plugin release :)