I am able to import tkinter in idle3 and used it to create a simple application and in Idle3 everything works great. The problem is, if I try to start the program from bash, I get the error:
ImportError: No module named 'tkinter.filedialog'; 'tkinter is not a package
Why would the pi be able to run a program in idle3 but not when start with
python3 program.py
It seems to be that idle3 recognizes the tkinter package but my bash cannot. Any Solutions?
The only thing I can think of is that it's being run with python
instead of python3
Make sure the shebang line is #!/usr/bin/env python3
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.