Good day. I installed pyhton 2 and python 3 in my laptop. And i\'m using python 3 interpreter in writing my codes. Here is my code.
#! /usr/bin/python3
from
python 2 and python 3 use tkinter
in a different way.
Note: Tkinter has been renamed to tkinter in Python 3. The 2to3 tool will automatically adapt imports when converting your sources to Python 3.
The above lines are from python documentation. Not sure if python is loading tkinter using python 2 or python 3..May be internal PYTHONPATH
is
messed up
Rather try this,
try:
import tkinter as tk
except ImportError:
import Tkinter as tk
Note: In these situations where you use multiple versions of same modules, try using virualenv
Virtual Env