Background
I have been struggling for the past few days to deploy a Lambda that uses Pillow, and I am deploying using Python 3.6. It may be noteworthy also that I am developing this on a Windows 10 environment.
First Attempts
I began by having pip install my packages strictly in my workspace by doing the following:
pip3 install pillow -t "D:Work and Projects......<projectdir>pillow"
I have other packages, and tried installing the packages in the same manor, one of them specifically was praw
and I did so by:
pip3 install praw -t "D:Work and Projects......<projectdir>praw"
After zipping the contents of my project together, I uploaded my package up to Lambda and upon my first test I received the error:
Unable to import module 'motw_lambda': cannot import name '_imaging'
I then removed the Pillow package in an attempt to see where this issue was stemming from (Pillow or praw or one of the other packages). With Pillow removed, the execution succeeded. I then removed the pillow
package in my package and tried:
pip3 install pillow -t "D:Work and Projects......<projectdir>PIL"
and
pip3 install pillow -t "D:Work and Projects......<projectdir>Pillow"
But got the same error with the package '_imaging'
.
Further Attempts
I then followed the directions per this resource and this. I also tried using virualenv and even lambda-uploader.
Strange enough, I get the same error! I am all out of options here, and feel either I am doing something dumb, or that this is not possible on Lambda-Python3.6 currently (Although I can't image someone else hasn't used pillow in a py3.6-lambda yet...)
Any info, help, or generic resources would be appreciated!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…