I am learning basic GUI in Python, and I came across a sample example to read file name from file explorer on Stack Overflow.
from Tkinter import Tk
from tkFileD
If you are hitting this kind of error in a python -m venv NAME
kind of virtual environment (and you actually have tcl installed in your system), then you need to export the paths similarly as suggested by Kamil Czerski in a previous post for virtualenv.
import tkinter root = tkinter.Tk() print(root.tk.exprstring('$tcl_library')) print(root.tk.exprstring('$tk_library'))
bin/activate
and find the place where they export PATH
and insert after this (insert correct paths from step 1):TCL_LIBRARY="/tcl/path/from/step/1" TK_LIBRARY="/tk/path/from/step/1" TKPATH="/tk/path/from/step/1" export TCL_LIBRARY TK_LIBRARY TKPATH
deactivate source bin/activate
The "Tcl missing"-error should be gone.