سؤال

Although I have downloaded ttk from https://pypi.python.org/pypi/pyttk/ and installed it using:

python setup.py install

and got:

enter image description here

I still can't run my script which uses ttk:

from Tkinter import ttk
ImportError: cannot import name ttk

What is wrong?

هل كانت مفيدة؟

المحلول

I think ttk is installed as a top-level import. Try

import ttk

نصائح أخرى

Try this instead:

from Tkinter import *
import ttk
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top