Jump to content

Error importing tkinter


---
 Share

Recommended Posts

I am trying to use tkinter to create a progress bar indicator for different calculations in my script.

tkinter is included in every Python installation. I have opened Python in a command line from its GOM's installation folder and I can import and test tkinter without problems, but when I try to do same operation from the script editor I get an error No module named tkinter.ttk;tkinter is not a package

#--------------------------
# import additional modules
#--------------------------
from tkinter import *
from tkinter import ttk

Any suggestion?

Thanks

Edited
Link to comment
Share on other sites

Hello Andreu, 

It seems that tkinter is not installed with GOM but they have implemented a way to install the packages. You have to go to Scripting/ Script choice/tools/Install Python package      then write the package you are looking for (maybe you can try tk as the package to install).

Unfortunately, in my case it didn't work due to limited access via proxy. I had to go through the dos command, in the Gom python folder then type :

python -m pip install --proxy="myproxy:port" --user tk

where tk is obviously for tkinter.

You can also do the same for numpy, matplotlib

I hope it helps you

 

Link to comment
Share on other sites

 Share

×
×
  • Create New...