Opened 8 years ago

Closed 7 years ago

#481 closed defect (fixed)

The _imaging C module is not installed on QGIS 2.12.x Windows 32 bits

Reported by: jhemmi Owned by: osgeo4w-dev@…
Priority: minor Component: Installer
Version: Keywords: QGIS Matplotlib _imaging
Cc:

Description

I was following the QGIS issu #13192 since two users of my plugin (PhysiocapAnalyseur) have experimented the error "The _imaging C module is not installed" when writing a tiff with Matplotlib.

It seems to be an installation problem on Windows 32 bits only.

I have reproduced the context problem on an old eeepc 32 bit with a fresh install of QGIS 2.12.2 ( QGIS-OSGeo4W-2.12.2-1-Setup-x86.exe ) in the Console Python:

import PIL

from PIL import _imaging

finish with "DLL load failed" on Windows 32 bits where

matplotlib.version

'1.2.1'

PIL.Image.VERSION

'1.1.7'

It's OK on Linux or Windows 64 bits where

matplotlib.version

'1.3.1'

PIL.VERSION

'1.1.7'

Change History (13)

comment:1 by jhemmi, 8 years ago

No news about this problem. I checked others issues that can be related : #326, #451 which are open too.

Is 32 bits prohibited for osgeo ?

Last edited 8 years ago by jef (previous) (diff)

comment:2 by jef, 8 years ago

Does it work if you upgrade matplotlib via pip?

comment:3 by jakosek, 7 years ago

Problem is bit old now, but still persist. I use only PIL modules (without matplotlib) and meet same behavior, problems with import "The _imaging C module is not installed". Solution is to install Pillow instead old PIL. Nice to have Pillow included in new installers (also - only Pillow exist for Python > 3).

comment:4 by mkuhn, 7 years ago

I copied some missing files from Pillow as a workaround. More complete description here:

http://stackoverflow.com/a/43657594/2319028

comment:5 by jef, 7 years ago

import PIL
import Image
import _imaging

doesn't seem to show the problem (python-pil-1.1.7-1)

comment:6 by jakosek, 7 years ago

Could you check also

from PIL import ImageDraw, ImageFont
Last edited 7 years ago by jakosek (previous) (diff)

comment:7 by jef, 7 years ago

hm, works for me too.

comment:8 by mkuhn, 7 years ago

It failed for me when used by reportlab and integrating a .png file.

Are _imaging* files present in your apps/Python27/site-packages/PIL folder?

comment:9 by jef, 7 years ago

Sure - as python-pil-1.1.7-1.tar.bz2 has them (did also verify that the standalone installers have them - in case this was not strictly about osgeo4w).

C:\OSGeo4W>python
Python 2.7.4 (default, Apr  6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> from PIL import ImageDraw, ImageFont
>>> import _imaging
>>> quit()

C:\OSGeo4W>dir /s /b _imaging*.*
C:\OSGeo4W\apps\Python27\Lib\site-packages\PIL\_imaging.pyd
C:\OSGeo4W\apps\Python27\Lib\site-packages\PIL\_imagingcms.pyd
C:\OSGeo4W\apps\Python27\Lib\site-packages\PIL\_imagingft.pyd
C:\OSGeo4W\apps\Python27\Lib\site-packages\PIL\_imagingmath.pyd
C:\OSGeo4W\apps\Python27\Lib\site-packages\PIL\_imagingtk.pyd

comment:10 by jakosek, 7 years ago

As I remember problem with PIL was not missing files, but precompiled module with bad paramerets. Main problem is pointed on stackoverflow:

The freetype C library references a debug CRT that is not available on all machines. You can easily patch the _imagingft.pyd file with a hex editor.

Pillow modules work on all tested computers.

comment:11 by jef, 7 years ago

python-pil upgraded to python-pillow

comment:12 by mkuhn, 7 years ago

Thanks, @jef

comment:13 by jef, 7 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.