Skip to content

tkinter on redhat (and testing of tkinter) #5

@chrisjsewell

Description

@chrisjsewell

for Ubunut, there is a python3.x-tk package available for 3.6-3.8 (via deadsnakes repo).

However, this is not the case for base yum in redhat:

centos8:

[root@instance ~]# yum search tkinter
Last metadata expiration check: 0:15:10 ago on Thu 26 Nov 2020 12:57:02 PM UTC.
============================================= Name Matched: tkinter ==============================================
python3-tkinter.x86_64 : A GUI toolkit for Python
python2-tkinter.x86_64 : A graphical user interface for the Python 2 scripting language
python3-tkinter.i686 : A GUI toolkit for Python
python3-tkinter.x86_64 : A GUI toolkit for Python
python38-tkinter.x86_64 : A GUI toolkit for Python

fedora31:

python3-tkinter.x86_64 : A GUI toolkit for Python
python2-tkinter.i686 : A graphical user interface for the
                     : Python 2 scripting language
python2-tkinter.x86_64 : A graphical user interface for the
                       : Python 2 scripting language
python3-tkinter.i686 : A GUI toolkit for Python
python3-tkinter.x86_64 : A GUI toolkit for Python

Current;y I a'm "falling back" to just install python3-tkinter if python3x-tkinter fails, but I don't know if that will actually work.

Ideally we would also test that tkinter is working on all distributions.
This is tricky though, because really you need a display:

[root@instance ~]# python3.8
Python 3.8.0 (default, May  7 2020, 02:49:39) 
[GCC 8.3.1 20191121 (Red Hat 8.3.1-5)] 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/lib64/python3.8/tkinter/__init__.py", line 4552, in _test
    root = Tk()
  File "/usr/lib64/python3.8/tkinter/__init__.py", line 2261, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions