quantumpotato quantumpotato - 13 days ago 11
Python Question

No module named imutils.pespective after pip installing

I am trying to follow this tutorial which requires

imtools
. It looks like I have the package installed, but the Python compiler cannot find it. What's going on here?

Tutorial: http://www.pyimagesearch.com/2016/10/03/bubble-sheet-multiple-choice-scanner-and-test-grader-using-omr-python-and-opencv/

~/py:. cat test_grader.py
from imutils.perspective import four_point_transform~

~/py:. python test_grader.py
Traceback (most recent call last):
File "test_grader.py", line 1, in <module>
from imutils.perspective import four_point_transform
ImportError: No module named imutils.perspective

~/py:pip install imtools
Requirement already satisfied: imtools in /usr/local/lib/python2.7/site-packages
Requirement already satisfied: matplotlib in /usr/local/lib/python2.7/site-packages (from imtools)
Requirement already satisfied: pyyaml in /usr/local/lib/python2.7/site-packages (from imtools)
Requirement already satisfied: numpy in /usr/local/lib/python2.7/site-packages (from imtools)
Requirement already satisfied: scipy in /usr/local/lib/python2.7/site-packages (from imtools)
Requirement already satisfied: python-dateutil in /usr/local/lib/python2.7/site-packages (from matplotlib->imtools)
Requirement already satisfied: pyparsing!=2.0.0,!=2.0.4,>=1.5.6 in /usr/local/lib/python2.7/site-packages (from matplotlib->imtools)
Requirement already satisfied: cycler in /usr/local/lib/python2.7/site-packages (from matplotlib->imtools)
Requirement already satisfied: pytz in /usr/local/lib/python2.7/site-packages (from matplotlib->imtools)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python2.7/site-packages (from python-dateutil->matplotlib->imtools)
~/py:.

Answer

Seems like you just installed wrong package. The tutorial says you need imutils but you installed imtools instead. Try to install imutils:

pip install --upgrade imutils