TransWikia.com

Qgis 3.16.3 - tk package, ModuleNotFoundError: No module named '_tkinter'

Geographic Information Systems Asked by Omri on March 8, 2021

I am developing a plugin that uses tk package. When I tried to import tk I got an error: ModuleNotFoundError: No module named ‘_tkinter’. I tried to reinstall tk but it didn’t work. I would say that when i used local python tk package works.

One Answer

QGIS uses PyQt for ui, and it doesn't come with a preinstalled Tkinter python package.
I would recommend you either include the relevant package code with your plugin (if the license allows for that),
or use PyQt to build your interface.

I would recommend learning PyQt and using the included Qt Designer as instructed here in the pyqgis developer cookbook.

Correct answer by Dror Bogin on March 8, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP