I’m author of an addon that uses PIL/Pillow. I’m supplying the PIL folder from Pillow for win64, linux64 and macos. Each of these incude some compiled os specific files. I ask users to put the PIL folder in the user scripts folder’s sub directory modules.
I’m then doing ‘from PIL import Image’ in the addon.
This works very well and I’m using it without issues on all of the 3 operating systems. It also works great for the vast majority of the addon’s users.
I have a few users for whom importing the Image module fails however (1 x win7 64, 1x win8 64, 1xwin10 64, 1x macos).
Note, that for these users importing PIL itself works fine, so the module can be found by the blender bundled python without problems and is in the proper location. But importing Image, from PIL, will fail
Some people are seing:
ImportError: cannot import name ‘_imaging’
ImportError: DLL load failed.
This one comes in two flavors:
From what I’ve found by searching, this indicates a version conflict between python and a module, so the module being compiled for the wrong python version. The thing is, all these people use Python 3.5.2 as it is the one bundled with 2.78 and it’s also the one I compiled the PIL, I supply, against.
I can kind of (but not really) reproduce this error by putting a macos PIL or windows PIL in my modules folder on a linux machine. But I’ve been assured and have confirmed this is not what’s happening for those users. They do use the proper PIL for their OS.
So, just to make sure, I’ve walked some of these people through a manual installation of PIL/Pillow and asked them to remove the PIL, I supply, from their modules folder. This is to ensure they indeed have the proper PIL for their os installed. I instruct them to:
- remove the modules/PIL folder, you don’t need it anymore
2. open ‘cmd’ as an admin and navigate to the blender installation folder (c:\program files\Blender Foundation…)
3. find the 2.78\python\bin folder, you are looking for a file called ‘python.exe’
4. download https://bootstrap.pypa.io/get-pip.py and put it into the bin folder
5. in cmd, from the bin folder, type ‘python.exe get-pip.py’
6. when done, go one folder up(from bin) and go into the (new) Scripts folder. You are looking for a file called ‘pip.exe’
7. when you’ve found it, run ‘pip.exe install pillow’
Unfortunately they still get the same error, so I’m now out of my depth and can’t help any further.
I’d appreciate any input on this, especially:
- How can it work for the majority, but not for a few others, when they are all using the same blender bundled python?
- How does the manual PIL/Pillow installation for their blender bundled python not solve this?
- What more can I try?