Install tkinter and python locally Install tkinter and python locally tkinter tkinter

Install tkinter and python locally


Use CPPFLAGS environment variable to set the include directories for tcl and tk before building Python 3. This has worked for me.

export CPPFLAGS="-I/home/sam/install_sam/tcl/include -I/home/sam/install_sam/tk/include"


Finally. I install tcl/tk and python in a same path. It can work now. the commands as follow:

cd ~/Downloads/tcl8.5.11/unix./configure --prefix=/home/sam/install_sam/python3makemake installcd ~/Downloads/tk8.5.11/unix./configure --prefix=/home/sam/install_sam/python3            --with-tcl=/home/sam/Downloads/tcl8.5.11/unixmakemake installexport LD_LIBRARY_PATH=/home/sam/install_sam/python3/libcd ~/Downloads/Python3.2.3/3./configure --prefix=/home/sam/install_sam/python3 makemake install

someone can tell me how to config the tcl/tk for python in the first way(mentioned in the question). I'll appreciate it


sudo apt-get install tcl-dev tk-dev

worked for me, although I ended up pulling a docker image and using that instead.