Is there a gui library that has already been ported to python 3? I'm interested in using some of the new python 3 features in the back end for my project.

Dani AI

Generated

Brief update for readers coming across this old thread: back in 2009 was right that the immediate Python‑3 option was the standard Tk wrapper (note the lowercase tkinter in Python 3, as observed). Since then several major GUI toolkits have mature Python‑3 support — PyQt (PyQt5/PyQt6), the official Qt for Python bindings (PySide6), the wxPython Phoenix project (the modern wxPython for Python 3), and Kivy for touch/mobile‑oriented apps. (docs.python.org)

For quick compatibility handling (useful if maintaining old examples alongside Python 3) use a tiny import shim before your GUI code:

try:
    import tkinter as tk      # Python 3
except ImportError:
    import Tkinter as tk      # Python 2 fallback

On Linux a missing tkinter usually means you need the OS package (python3-tk or python3-tkinter depending on distro); with virtualenvs or custom‑built Pythons you may need to install the Tcl/Tk dev libraries and rebuild or recreate the venv. (packages.ubuntu.com)

If choosing a toolkit, match it to goals: Qt (PySide6 or PyQt6) for rich, cross‑platform desktop apps and designer tools; wxPython if you want a native look/feel with a native widget set; Kivy when targeting mobile/touch; PySimpleGUI for very fast forms (it wraps other backends). Install easily with pip (pip install PyQt6, pip install pyside6, pip install wxPython, pip install kivy), and check licensing (PyQt is GPL/commercial from Riverbank; PySide is provided under LGPL/GPL via Qt). If you preferred wx or PyQt in 2009 (see and ) — both now have stable Python‑3 paths. (riverbankcomputing.com)

Troubleshooting pointers: test imports in a fresh system Python (outside venv) to isolate OS vs. environment issues; read each project’s “getting started” or install page before packaging (PyInstaller and platform wheels sometimes need extra flags). The official docs linked above are the best source for up‑to‑date installation and packaging notes.

Recommended Answers

All 8 Replies

Is there a gui library that has already been ported to python 3? I'm interested in using some of the new python 3 features in the back end for my project.

For the time being you will have to use good old Tkinter that ships with Python3.0.

I completely forgot about Tkinter. It would probably work for the time being.

hmm, which do you guys use often and prefer?

I prefer wxpython.
Honestly I will never move to Python 3 until wxpython comes out!

I happen to prefer pyQt, which isn't out for python 3 yet.

There seems to be no Tkinter in python three either, unless I'm doing it wrong:

Traceback (most recent call last):
  File "<pyshell#3>", line 1, in <module>
    import Tkinter
ImportError: No module named Tkinter

EDIT: Back in my Tkinter days, I was used to importing Tkinter, not tkinter. Problem solved.

Here is my console output on Mandriva linux 2009:

Python 3.0 (r30:67503, Dec  9 2008, 13:32:06)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter
>>>

I think that all library module names have been converted to lowercase in python 3.0.

Here is my console output on Mandriva linux 2009:

Python 3.0 (r30:67503, Dec  9 2008, 13:32:06)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter
>>>

I think that all library module names have been converted to lowercase in python 3.0.

Good observation!
Before Python 3.0 the wrapper Tkinter.py was called, now Tkinter has turned into a more modern package with the directory name tkinter that uses _init__.py as the wrapper.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.