简体   繁体   中英

Python: ttk cannot be installed

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

python setup.py install

and got:

在此处输入图片说明

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM