1
I’m still a beginner in the world of programming, and I recently came across a problem that is still unsolved.
I’m using an interactive online book to learn python (How to think like a computer Scientist). In one of the chapters, the book teaches how to work with image processing. As the book is interactive, it offers its own platform for writing and running the lines of code, Activecode. The problem starts when in the book development tool, the "image" module is present and working, but in version 3 of the python I use, no.
The version that the book works on is the same one that I work on. I use the iPython3 notebook tool running on Firefox to program. When I run a simple show like:
import image
p = image.Pixel(45, 76, 200)
print(p.getRed())
The program should return me the value "45", however an error message is displayed:
ImportError Traceback (most recent call last) <ipython-input-7-83aeecd92382> in <module>() ----> 1 import image 2 3 p = image.Pixel(45,76,200) 4 print(p.getRed()) ImportError: No module named 'image'
Anyway, how do I solve this problem, and get to run this module on my computer?
I read in some places people talking to use the Pil library with the command from PIL import Image
, but it didn’t work. Apparently they’re different things.
System specification: Elementary OS 0.3.2 Freya (64-bit) Built on Ubuntu 14.04 Lenovo Y430 notebook
Follow the link from the site for you to take a look: How To Think Like a Computer Scientist
usually the library
image
is not installed by default in python, please install the libraryPillow
– Brumazzi DB
Already tried using import Image ?
– user44344
Yes, and the error persists. mportError Traceback (Most recent call last) <ipython-input-3-e90509fea2a2> in <module>() -----> 1 import Image 2 3 p = image.Pixel(45,76,200) 4 print(p.getRed()) Importing: No module named 'Image''
– Gabriel Trettel
According to the developers website, to install Pillow, I need to uninstall PIL. as I uninstall the PIL library?
– Gabriel Trettel
Using these commands: To uninstall: Pip Uninstall PIL
– user44344
Try to uninstall Pil and install Pillow
– user44344
just uninstall PIL, install Pillow and restart the computer. the error continues.
– Gabriel Trettel
even with Pillow installed, the notebook ipython3 does not run this module.
– Gabriel Trettel