Skip to content Skip to sidebar Skip to footer

Python 2.7 - Importerror: No Module Named Image

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 im

Solution 1:

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

Solution 2:

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:

fromPILimportImage

but make sure Pillow is installed. Works for me.

Solution 3:

Try to put the python(2.7) at your Windows path. Do the following steps:

  1. Open System Properties (Win+Pause) or My Computer and right-click then Properties
  2. Switch to the Advanced tab
  3. Click Environment Variables
  4. Select PATH in the System variables section
  5. Click Edit
  6. Add python's path to the end of the list (the paths are separated by semicolons). example C:\Windows;C:\Windows\System32;C:\Python27

Post a Comment for "Python 2.7 - Importerror: No Module Named Image"