Recently, I have been studying OpenCV to detect and recognize faces using C++. In order to execute source code demonstration from the OpenCV website I need to run Python to crop image first. Unfortunately, the message error is 'ImportError: No module named Image'
when I run the Python script (this script is provided by OpenCV website). I installed "python-2.7.amd64" and downloaded "PIL-1.1.7.win32-py2.7" to install Image
library. However, the message error is 'Python version 2.7 required, which was not found in the registry'
. And then, I downloaded the script written by Joakim Löw for Secret Labs AB / PythonWare to register registry in my computer. But the message error is "Unable to register. You probably have the another Python installation"
.
I spent one month to search this issue on the internet but I cannot find the answer. Please support me to resolve my issue.
Thanks, Tran Dang Bao
The solution is very simple. You don't need to worry about x86 or 64 bit, all you have to do is import as follows:
but make sure Pillow is installed. Works for me.
You installed the 64-bit version of Python, but the 32-bit version of PIL. Either switch to the 32-bit version of Python, or you need a 64-bit version of PIL (not available that I could find). There is
pillow
, a PIL-compatible replacement that might work. A 64-bit version is available here:Pillow-2.1.0.win-amd64-py2.7.exe
Try to put the python(2.7) at your Windows path. Do the following steps:
C:\Windows;C:\Windows\System32;C:\Python27