I am trying to build Python 3.12 with TCL/TK on RHEL 7.
I have 0 root privileges. My system build is HORRIBLY outdated. I have no control over this and cannot update/use package installers, which is why I've gone through this 'compiling from source' endeavor.
After digging around I found that there WAS a configure option in the past for --with-tcltk... but those options were removed. After looking in the whatsnew, I found that you can specify the custom locations using the envvars TCLTK_CFLAGS and TCLTK_LIBS. My tcl/tk installations are not in the same directory, they are under $HOME/.../tcl8.6 and $HOME/.../tk8.6 respectively. (I'm using abs path on the envvars)
I know I'm close, but after building using these variables I still can't import tkinter after compiling python3.12.1 on RHEL 7.
I have not found any information as to how to use those variables, which paths I need to specify/what is necessary or any examples of how to do this.
OK, found the answer to anyone who may have a similar issue. I was on the right track, but I missed -tcl8.6 and -tk8.6 options on the TCLTK_LIBS envvar.
Here is a link to the source of the post that helped me figure this out: Solution
I placed all the settings onto a script.
***In order to load tkinter, you'll need to export LD_LIBRARY_PATH with the tcl/tk/ssl library directories before starting python. Exporting this env var screws with a program that out workstations rely on, so I need to do this everytime I load python.