문제

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