• Is Tcl/Tk supported on Ubuntu Desktop Linux?

    From Alwyn Teh@21:1/5 to All on Sat Jan 22 14:37:59 2022
    I just installed the latest Ubuntu Desktop 21.10 and built Tcl.

    But Tk is not building on Ubuntu from the unix directory.

    alteh@alteh-VirtualBox:~/dev/Tcl-Tk/tk8.6.12/unix$ make
    gcc -c -I/home/alteh/dev/Tcl-Tk/tk8.6.12/unix/../unix -I/home/alteh/dev/Tcl-Tk/tk8.6.12/unix/../generic -I/home/alteh/dev/Tcl-Tk/tk8.6.12/unix/../bitmaps -O2 -pipe -Wall -Wpointer-arith -fPIC -DBUILD_tk -I/home/alteh/dev/Tcl-Tk/tcl8.6.12/generic -I/
    home/alteh/dev/Tcl-Tk/tcl8.6.12/unix -DPACKAGE_NAME=\"tk\" -DPACKAGE_TARNAME=\"tk\" -DPACKAGE_VERSION=\"8.6\" -DPACKAGE_STRING=\"tk\ 8.6\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_
    H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_PTHREAD_ATFORK=1 -DTCL_THREADS=1 -DMODULE_SCOPE=extern\ __
    attribute__\(\(__visibility__\(\"hidden\"\)\)\) -DHAVE_HIDDEN=1 -DHAVE_CAST_TO_UNION=1 -DTCL_SHLIB_EXT=\".so\" -DNDEBUG=1 -DTCL_CFG_OPTIMIZED=1 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_IS_LONG=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_INTPTR_T=1 -
    DHAVE_UINTPTR_T=1 -DHAVE_PW_GECOS=1 -DXKEYCODETOKEYSYM_IS_DEPRECATED=1 -DUSE_TCL_STUBS -fno-lto /home/alteh/dev/Tcl-Tk/tk8.6.12/unix/../generic/tkStubLib.c
    In file included from /home/alteh/dev/Tcl-Tk/tk8.6.12/unix/../generic/tkPort.h:21,
    from /home/alteh/dev/Tcl-Tk/tk8.6.12/unix/../generic/tkInt.h:19,
    from /home/alteh/dev/Tcl-Tk/tk8.6.12/unix/../generic/tkStubLib.c:14:
    /home/alteh/dev/Tcl-Tk/tk8.6.12/unix/../generic/tk.h:99:13: fatal error: X11/Xlib.h: No such file or directory
    99 | # include <X11/Xlib.h>
    | ^~~~~~~~~~~~
    compilation terminated.
    make: *** [Makefile:1168: tkStubLib.o] Error 1 alteh@alteh-VirtualBox:~/dev/Tcl-Tk/tk8.6.12/unix$

    Also, the built-in default Tck/Tk does not seem to be properly built and installed.

    alteh@alteh-VirtualBox:~/dev/Tcl-Tk/tk8.6.12/unix$ wish
    application-specific initialization failed: Can't find a usable tk.tcl in the following directories:
    /usr/local/lib/tcl8.6/tk8.6 /usr/local/lib/tk8.6 /usr/lib/tk8.6 /usr/lib/tk8.6 /lib/tk8.6 /usr/library

    This probably means that tk wasn't installed properly.

    %

    How can I get Tcl/Tk built and installed properly on Ubuntu please?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Robert Heller@21:1/5 to Alwyn Teh on Sat Jan 22 20:34:30 2022
    sudo apt install libx11-dev

    At Sat, 22 Jan 2022 14:37:59 -0800 (PST) Alwyn Teh <[email protected]> wrote:


    I just installed the latest Ubuntu Desktop 21.10 and built Tcl.

    But Tk is not building on Ubuntu from the unix directory.

    alteh@alteh-VirtualBox:~/dev/Tcl-Tk/tk8.6.12/unix$ make
    gcc -c -I/home/alteh/dev/Tcl-Tk/tk8.6.12/unix/../unix -I/home/alteh/dev/Tcl-Tk/tk8.6.12/unix/../generic -I/home/alteh/dev/Tcl-Tk/tk8.6.12/unix/../bitmaps -O2 -pipe -Wall -Wpointer-arith -fPIC -DBUILD_tk -I/home/alteh/dev/Tcl-Tk/tcl8.6.12/generic -I/
    home/alteh/dev/Tcl-Tk/tcl8.6.12/unix -DPACKAGE_NAME=\"tk\" -DPACKAGE_TARNAME=\"tk\" -DPACKAGE_VERSION=\"8.6\" -DPACKAGE_STRING=\"tk\ 8.6\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_
    H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_PTHREAD_ATFORK=1 -DTCL_THREADS=1 -DMODULE_SCOPE=extern\ __
    attribute__\(\(__visibility__\(\"hidden\"\)\)\) -DHAVE_HIDDEN=1 -DHAVE_CAST_TO_UNION=1 -DTCL_SHLIB_EXT=\".so\" -DNDEBUG=1 -DTCL_CFG_OPTIMIZED=1 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_IS_LONG=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_INTPTR_T=1 -
    DHAVE_UINTPTR_T=1 -DHAVE_PW_GECOS=1 -DXKEYCODETOKEYSYM_IS_DEPRECATED=1 -DUSE_TCL_STUBS -fno-lto /home/alteh/dev/Tcl-Tk/tk8.6.12/unix/../generic/tkStubLib.c
    In file included from /home/alteh/dev/Tcl-Tk/tk8.6.12/unix/../generic/tkPort.h:21,
    from /home/alteh/dev/Tcl-Tk/tk8.6.12/unix/../generic/tkInt.h:19,
    from /home/alteh/dev/Tcl-Tk/tk8.6.12/unix/../generic/tkStubLib.c:14:
    /home/alteh/dev/Tcl-Tk/tk8.6.12/unix/../generic/tk.h:99:13: fatal error: X11/Xlib.h: No such file or directory
    99 | # include <X11/Xlib.h>
    | ^~~~~~~~~~~~
    compilation terminated.
    make: *** [Makefile:1168: tkStubLib.o] Error 1 alteh@alteh-VirtualBox:~/dev/Tcl-Tk/tk8.6.12/unix$

    Also, the built-in default Tck/Tk does not seem to be properly built and installed.

    alteh@alteh-VirtualBox:~/dev/Tcl-Tk/tk8.6.12/unix$ wish
    application-specific initialization failed: Can't find a usable tk.tcl in the following directories:
    /usr/local/lib/tcl8.6/tk8.6 /usr/local/lib/tk8.6 /usr/lib/tk8.6 /usr/lib/tk8.6 /lib/tk8.6 /usr/library

    This probably means that tk wasn't installed properly.

    %

    How can I get Tcl/Tk built and installed properly on Ubuntu please?



    --

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Francois Vogel@21:1/5 to All on Sun Jan 23 12:38:13 2022
    Le 22/01/2022 à 23:37, Alwyn Teh a écrit :
    I just installed the latest Ubuntu Desktop 21.10 and built Tcl.

    But Tk is not building on Ubuntu from the unix directory.


    /home/alteh/dev/Tcl-Tk/tk8.6.12/unix/../generic/tk.h:99:13: fatal error: X11/Xlib.h: No such file or directory
    99 | # include <X11/Xlib.h>
    | ^~~~~~~~~~~~
    compilation terminated.

    You probably need to install the libx11-dev package.

    Regards,
    Francois

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From gsal@21:1/5 to Francois Vogel on Mon Jan 24 08:43:18 2022
    On Sunday, January 23, 2022 at 6:38:24 AM UTC-5, Francois Vogel wrote:
    Le 22/01/2022 à 23:37, Alwyn Teh a écrit :
    I just installed the latest Ubuntu Desktop 21.10 and built Tcl.

    But Tk is not building on Ubuntu from the unix directory.

    /home/alteh/dev/Tcl-Tk/tk8.6.12/unix/../generic/tk.h:99:13: fatal error: X11/Xlib.h: No such file or directory
    99 | # include <X11/Xlib.h>
    | ^~~~~~~~~~~~
    compilation terminated.
    You probably need to install the libx11-dev package.

    Regards,
    Francois


    Don't the tk sources come with their own ./xlib/X11/Xlib.h ?
    Maybe it is a matter of making sure that directory is in one of those "-I" (<--uppercase i) include paths?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Robert Heller@21:1/5 to gsal on Mon Jan 24 11:07:04 2022
    At Mon, 24 Jan 2022 08:43:18 -0800 (PST) gsal <[email protected]> wrote:


    On Sunday, January 23, 2022 at 6:38:24 AM UTC-5, Francois Vogel wrote:
    Le 22/01/2022 à 23:37, Alwyn Teh a écrit :
    I just installed the latest Ubuntu Desktop 21.10 and built Tcl.

    But Tk is not building on Ubuntu from the unix directory.

    /home/alteh/dev/Tcl-Tk/tk8.6.12/unix/../generic/tk.h:99:13: fatal error: X11/Xlib.h: No such file or directory
    99 | # include <X11/Xlib.h>
    | ^~~~~~~~~~~~
    compilation terminated.
    You probably need to install the libx11-dev package.

    Regards,
    Francois


    Don't the tk sources come with their own ./xlib/X11/Xlib.h ?
    Maybe it is a matter of making sure that directory is in one of those "-I" (<--uppercase i) include paths?

    That is a "fake" xlib/X11/Xlib.h for MS-Windows and MacOSX. Tk is written in terms of XLib and under MS-Windows and MacOSX some of the XLib-isms are
    "faked" in terms of MS-Windows or MacOSX GUI features. Under actual UNIX or Linux, Tk uses the Xlib.h provided by X11. A typical Linux distro separates the X11 runtime (shared) libraries from the X11 development stuff (header
    file, link libraries, etc.). Commonly a normal Linux Desktop install just installs the runtime. It is necessary to install the -dev (-devel under RedHat-ish distros) packages if one plans on building tcl/tk from sources.

    The OP *could* have just installed tcl and tk from the distro:

    sudo apt install tcl tk

    But I guess he wanted to build from source...





    --
    Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364
    Deepwoods Software -- Custom Software Services
    http://www.deepsoft.com/ -- Linux Administration Services
    [email protected] -- Webhosting Services

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From lew-e jones-ayres@21:1/5 to Robert Heller on Wed Feb 22 15:48:15 2023
    On Monday, 24 January 2022 at 17:07:12 UTC, Robert Heller wrote:
    At Mon, 24 Jan 2022 08:43:18 -0800 (PST) gsal <[email protected]> wrote:


    On Sunday, January 23, 2022 at 6:38:24 AM UTC-5, Francois Vogel wrote:
    Le 22/01/2022 à 23:37, Alwyn Teh a écrit :
    I just installed the latest Ubuntu Desktop 21.10 and built Tcl.

    But Tk is not building on Ubuntu from the unix directory.

    /home/alteh/dev/Tcl-Tk/tk8.6.12/unix/../generic/tk.h:99:13: fatal error: X11/Xlib.h: No such file or directory
    99 | # include <X11/Xlib.h>
    | ^~~~~~~~~~~~
    compilation terminated.
    You probably need to install the libx11-dev package.

    Regards,
    Francois


    Don't the tk sources come with their own ./xlib/X11/Xlib.h ?
    Maybe it is a matter of making sure that directory is in one of those "-I" (<--uppercase i) include paths?
    That is a "fake" xlib/X11/Xlib.h for MS-Windows and MacOSX. Tk is written in terms of XLib and under MS-Windows and MacOSX some of the XLib-isms are "faked" in terms of MS-Windows or MacOSX GUI features. Under actual UNIX or Linux, Tk uses the Xlib.h provided by X11. A typical Linux distro separates the X11 runtime (shared) libraries from the X11 development stuff (header file, link libraries, etc.). Commonly a normal Linux Desktop install just installs the runtime. It is necessary to install the -dev (-devel under RedHat-ish distros) packages if one plans on building tcl/tk from sources.

    The OP *could* have just installed tcl and tk from the distro:

    sudo apt install tcl tk

    But I guess he wanted to build from source...





    --
    Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364
    Deepwoods Software -- Custom Software Services
    http://www.deepsoft.com/ -- Linux Administration Services [email protected] -- Webhosting Services

    Hi I know this is an old post but I've been through every forum trying to fix this issue. I need tkinter for my ubuntu virtual machine, I've checked im in the correct python, installed all the packages including the one Robert suggested (though
    installing from distro so I shouldn't have to). Nothing. I even tried manually copying the tk8.6 directory into lib and tcl8.6, no effect.
    Just:

    lewie@lewie-virtual-machine:~/Downloads$ python3

    Python 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    import tkinter
    tkinter._test()
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/lib/python3.10/tkinter/__init__.py", line 4586, in _test
    root = Tk()
    File "/usr/lib/python3.10/tkinter/__init__.py", line 2299, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
    _tkinter.TclError: Can't find a usable tk.tcl in the following directories:
    /usr/local/lib/tcl8.6/tk8.6 /usr/local/lib/tk8.6 /usr/lib/tk8.6 /usr/lib/tk8.6 /lib/tk8.6 /usr/library

    This probably means that tk wasn't installed properly.



    incidentally the /tk8.6/ dir only contains "pkgIndex.tcl"
    in case that's what's wrong.

    Any help would be great

    Lewie

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Christian Gollwitzer@21:1/5 to All on Thu Feb 23 08:12:07 2023
    Am 23.02.23 um 00:48 schrieb lew-e jones-ayres:
    On Monday, 24 January 2022 at 17:07:12 UTC, Robert Heller wrote:
    At Mon, 24 Jan 2022 08:43:18 -0800 (PST) gsal <[email protected]> wrote:


    On Sunday, January 23, 2022 at 6:38:24 AM UTC-5, Francois Vogel wrote:
    Le 22/01/2022 à 23:37, Alwyn Teh a écrit :
    I just installed the latest Ubuntu Desktop 21.10 and built Tcl.

    But Tk is not building on Ubuntu from the unix directory.

    /home/alteh/dev/Tcl-Tk/tk8.6.12/unix/../generic/tk.h:99:13: fatal error: X11/Xlib.h: No such file or directory
    99 | # include <X11/Xlib.h>
    | ^~~~~~~~~~~~
    compilation terminated.
    You probably need to install the libx11-dev package.

    Regards,
    Francois


    Don't the tk sources come with their own ./xlib/X11/Xlib.h ?
    Maybe it is a matter of making sure that directory is in one of those "-I" (<--uppercase i) include paths?
    That is a "fake" xlib/X11/Xlib.h for MS-Windows and MacOSX. Tk is written in >> terms of XLib and under MS-Windows and MacOSX some of the XLib-isms are
    "faked" in terms of MS-Windows or MacOSX GUI features. Under actual UNIX or >> Linux, Tk uses the Xlib.h provided by X11. A typical Linux distro separates >> the X11 runtime (shared) libraries from the X11 development stuff (header
    file, link libraries, etc.). Commonly a normal Linux Desktop install just
    installs the runtime. It is necessary to install the -dev (-devel under
    RedHat-ish distros) packages if one plans on building tcl/tk from sources. >>
    The OP *could* have just installed tcl and tk from the distro:

    sudo apt install tcl tk

    But I guess he wanted to build from source...





    --
    Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364
    Deepwoods Software -- Custom Software Services
    http://www.deepsoft.com/ -- Linux Administration Services
    [email protected] -- Webhosting Services

    Hi I know this is an old post but I've been through every forum trying to fix this issue. I need tkinter for my ubuntu virtual machine, I've checked im in the correct python, installed all the packages including the one Robert suggested (though
    installing from distro so I shouldn't have to). Nothing. I even tried manually copying the tk8.6 directory into lib and tcl8.6, no effect.
    Just:

    lewie@lewie-virtual-machine:~/Downloads$ python3

    Python 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    import tkinter
    tkinter._test()
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/lib/python3.10/tkinter/__init__.py", line 4586, in _test
    root = Tk()
    File "/usr/lib/python3.10/tkinter/__init__.py", line 2299, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
    _tkinter.TclError: Can't find a usable tk.tcl in the following directories:
    /usr/local/lib/tcl8.6/tk8.6 /usr/local/lib/tk8.6 /usr/lib/tk8.6 /usr/lib/tk8.6 /lib/tk8.6 /usr/library

    This probably means that tk wasn't installed properly.



    incidentally the /tk8.6/ dir only contains "pkgIndex.tcl"
    in case that's what's wrong.


    This is strange at the very least. Besides pkgIndex.tcl, there should be
    a folder with a lot of support files (scripts, icons, demos,...). It is basically this stuff:

    https://github.com/tcltk/tk/tree/main/library

    So maybe the package from your distro is simply broken? Or, the package
    from the distro is installed somewhere else, and Tcl picks up a broken
    version first and can't find the right version. You can check the path
    where Tcl looks for packages like this:

    (base) Apfelkiste:~ chris$ python3
    Python 3.8.8 (default, Apr 13 2021, 12:59:45)
    [Clang 10.0.0 ] :: Anaconda, Inc. on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    import tkinter
    interp=tkinter.Tcl()
    interp.eval("set auto_path")
    '/Users/chris/bin/anaconda3/lib/tcl8.6 /Users/chris/bin/anaconda3/lib'


    and afterwards try to load Tk manually:

    interp.eval("package require Tk")
    '8.6.10'

    then this should tell you, which version was loaded:

    interp.eval("package ifneeded Tk 8.6.10")
    'load /Users/chris/bin/anaconda3/lib/libtk8.6.dylib Tk'


    Christian

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)