nationaldronesau/FlirImageExtractor

ModuleNotFoundError: No module named '_tkinter'

Closed this issue · 2 comments

Installed via brew:

$ pip --version
pip 22.1.2 from /usr/local/lib/python3.10/site-packages/pip (python 3.10)

$ pip install flir-image-extractor-cli
[... omitted ...]

$ flir-image-extractor-cli --help
Traceback (most recent call last):
  File "/usr/local/bin/flir-image-extractor-cli", line 5, in <module>
    from flir_image_extractor_cli.__main__ import main
  File "/usr/local/lib/python3.10/site-packages/flir_image_extractor_cli/__main__.py", line 5, in <module>
    import flir_image_extractor_cli.processing as processing
  File "/usr/local/lib/python3.10/site-packages/flir_image_extractor_cli/processing.py", line 10, in <module>
    matplotlib.use("TkAgg")
  File "/usr/local/lib/python3.10/site-packages/matplotlib/__init__.py", line 1144, in use
    plt.switch_backend(name)
  File "/usr/local/lib/python3.10/site-packages/matplotlib/pyplot.py", line 288, in switch_backend
    class backend_mod(matplotlib.backend_bases._Backend):
  File "/usr/local/lib/python3.10/site-packages/matplotlib/pyplot.py", line 289, in backend_mod
    locals().update(vars(importlib.import_module(backend_name)))
  File "/usr/local/Cellar/python@3.10/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/usr/local/lib/python3.10/site-packages/matplotlib/backends/backend_tkagg.py", line 1, in <module>
    from . import _backend_tk
  File "/usr/local/lib/python3.10/site-packages/matplotlib/backends/_backend_tk.py", line 7, in <module>
    import tkinter as tk
  File "/usr/local/Cellar/python@3.10/3.10.5/Frameworks/Python.framework/Versions/3.10/lib/python3.10/tkinter/__init__.py", line 37, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
ModuleNotFoundError: No module named '_tkinter'

the exception should caught and suggestion be offered.

also, if this is a cli program why it would require Tk which is Gui widget?

Workaround install with python3.9 and install python-tk:

pip3.9 install flir-image-extractor-cli
brew install python-tk

fixed. it's both cli and gui and python-tk has been moved to extra dependacy and won't install