I would guess that the official Jenkins docker image does not include the
Python imaging library by default.  You probably need to install the python
imaging library by adding an entry to your Dockerfile:

RUN apt-get update && apt-get install -y python-imaging

You may also need to refer to
http://askubuntu.com/questions/156484/how-do-i-install-python-imaging-library-pil


Mark Waite


On Sun, May 22, 2016 at 11:44 PM Cherry Tsai <che...@honixtech.com> wrote:

> Hi guys,
>
> I had python trouble. I want to compare two images using python in
> Jenkins.
>
> When I added "import Image" or "from PIL import Image" in my script, it
> will show error message "ImportError: No module named Image".
>
> But use "import os, time", it was working.
>
>
> Basic environment:
>
>    1.
>
>    use docker official jenkins
>    2.
>
>    python 2.7
>    3.
>
>    PYTHONPATH is /usr/lib/python2.7/dist-packages/PIL
>    /usr/lib/python2.7/dist-packages/PIL
>    4.
>
>    Sys.path is ['', '/usr/lib/python2.7',
>    '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk',
>    '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload',
>    '/usr/local/lib/python2.7/dist-packages',
>    '/usr/lib/python2.7/dist-packages',
>    '/usr/lib/python2.7/dist-packages/PILcompat']
>
>
> Please help me how to solve it?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/83a816a4-d55d-42ad-8e09-84657d85b4a9%40googlegroups.com
> <https://groups.google.com/d/msgid/jenkinsci-users/83a816a4-d55d-42ad-8e09-84657d85b4a9%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtEwh%3DXA2KxVjbV0w8q-_GiKh8K5cKsjOrGy%3DVFVqe_%3DWg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to