Tkinter - cannot import tklib

David bouncingcats at gmail.com
Tue Jun 21 06:32:51 EDT 2022


On Tue, 21 Jun 2022 at 09:22, Wolfgang Grafen <wolfgang.grafen at gmail.com> wrote:

> I am an experienced Python user and struggle with following statement:
>
> >>> from tklib import *
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> ModuleNotFoundError: No module named 'tklib'

[...]

> I did not find a python module called tklib to install.

Ok, see below for how to find that file.

[...]

> I assume it should be installed by default with every python installation

It appears that your assumption is wrong. It appears to me that the
missing file is part of the tk-tutorial project.

> https://tk-tutorial.readthedocs.io/en/latest/intro/intro.html?highlight=app#

> First time that I cannot help myself. Please help, what do I do wrong?

Hi, here is a description how I found the file you seek:

Go to https://tk-tutorial.readthedocs.io/en/latest/intro/intro.html

At the top right of the page, see hyperlink "Edit on GitHub".
Click hyperlink takes you to
  https://github.com/rasql/tk-tutorial/blob/master/docs/intro/intro.rst
which is the same content rendered from 'rst' format I assume.

At top left of that page, see hyperlinks "tk-tutorial"/"docs"/"intro"
and "rasql"/"tk-tutorial".

Click one of the "tk-tutorial" hyperlinks to go to the top directory
of the project at:
  https://github.com/rasql/tk-tutorial

On that page near the very top, see a list of hyperlinks to
directories and files of the project. One of those hyperlinks
is labelled "tklib.py". Click that link to see the file at
  https://github.com/rasql/tk-tutorial/blob/master/tklib.py

On that page, click the "Raw" button. Then you can use "save as"
in your browser. Or you can just download it by some other
method from the link given in the previous paragraph.


More information about the Python-list mailing list