I am new to python can any body please Help
D:\python\sub>python app.py Traceback (most recent call last): File "app.py", line 2, in <module> import ImageTk ImportError: No module named ImageTk
This says that python is installed in non-standard location so the OS can not find ImageTk as it look in standard locations. You can re-install Python in a standard location, and where that is depends on which operating system and which installer you are using, or append this location to sys.path. I'm using Ubuntu 13.04 and I simply install ImageTk package by using terminal like:
sudo apt-get install python-imaging-tk
I had to import the PIL.ImageTk module separately. The line of code
import PIL
did not import the PIL.ImageTk module and I had to additionally use
from PIL import ImageTk
and then it worked fine in the Enthought Canopy 1.0 distribution of Python 2.7.
The need for that solution was suggested by this redhat bug resolution:https://bugzilla.redhat.com/show_bug.cgi?id=247171
This could also be accomplished with import PIL.ImageTk
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With