Results 1 to 6 of 6

Thread: ttk module not found

  1. #1
    Join Date
    Nov 2015
    Beans
    4

    ttk module not found

    I have installed python3, python3-tk. In this case I thoufht ttk would be supported, but when I include following lines in the python script:
    import tkinter as tk
    from tkinter import *
    from ttk import *
    I get the error: ImportError: No module named 'ttk'

    What is goiing wrong?

  2. #2
    Join Date
    Apr 2012
    Beans
    7,256

    Re: ttk module not found

    Hello and welcome to the forums

    What version of Ubuntu? How did you install python3?

    All current version of Ubuntu ship with python3 by default, I think - including the ttk module as part of the standard library

  3. #3
    Join Date
    Nov 2015
    Beans
    4

    Re: ttk module not found

    Thanks for the quick response. I am using ubuntu 14.04 LTS and installed the packages using the synaptic package manager

  4. #4
    Join Date
    Nov 2015
    Beans
    4

    Re: ttk module not found

    I have attached a file as result of the command find . | grep python3.4 > ~/python3_4.txt and zipped it
    Attached Files Attached Files

  5. #5
    Join Date
    Apr 2012
    Beans
    7,256

    Re: ttk module not found

    It looks like the commands you are using are appropriate for python2.x, whereas for python3.x it should be

    Code:
    from tkinter import *
    from tkinter.ttk import *
    See https://docs.python.org/3/library/tkinter.ttk.html

  6. #6
    Join Date
    Nov 2015
    Beans
    4

    Re: ttk module not found

    Thanks,
    ttk is working now. I got the lines from an external example.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •