Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #9454

Re: should i install python image library by myself?

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeder.news-service.com!xlned.com!feeder7.xlned.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <chris@rebertia.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'python': 0.08; 'exception.': 0.09; 'subject:image': 0.09; 'subject:library': 0.09; 'tkinter': 0.09; 'wed,': 0.12; 'subject:python': 0.12; 'wrote:': 0.15; 'library': 0.15; 'module?': 0.16; 'skip:\xc2 30': 0.16; 'subject:install': 0.16; 'throws': 0.16; 'url:pythonware': 0.16; 'pil': 0.16; 'cc:addr:python-list': 0.16; 'pm,': 0.16; '2.x': 0.19; 'command': 0.19; 'cheers,': 0.19; 'cc:2**0': 0.21; 'header:In-Reply-To:1': 0.22; 'module,': 0.23; 'received:209.85.213.46': 0.23; 'received:mail- yw0-f46.google.com': 0.23; 'refers': 0.23; 'wrong?': 0.23; 'versions': 0.23; 'wonder': 0.23; 'expect': 0.25; 'work.': 0.28; 'guess': 0.28; 'url:products': 0.28; 'message-id:@mail.gmail.com': 0.28; 'import': 0.29; 'skip:i 30': 0.29; 'cc:addr:python.org': 0.30; 'module': 0.30; '3.x': 0.30; 'imported': 0.30; 'version': 0.30; 'installation': 0.30; 'class': 0.31; 'url:library': 0.31; 'subject:?': 0.31; 'chris': 0.32; 'does': 0.32; 'typically': 0.33; "what's": 0.33; 'it?': 0.34; 'there': 0.34; 'follows:': 0.34; 'latter': 0.35; 'module.': 0.35; 'surprised': 0.35; 'thus,': 0.35; 'url:python': 0.37; 'some': 0.37; 'received:google.com': 0.38; 'received:209.85': 0.38; 'url:org': 0.38; 'subject:: ': 0.38; 'think': 0.38; 'should': 0.39; 'correctly': 0.39; 'url:docs': 0.39; 'either': 0.39; 'received:209': 0.40; 'your': 0.60; 'details': 0.65; 'exact': 0.69; 'sender:addr:chris': 0.84; 'subject:myself': 0.84; 'subject:should': 0.84; 'url:rebertia': 0.84; 'or:': 0.91; 'surprise': 0.96
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=rebertia.com; s=google; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=EfDuyn9RMo9VHYnOCXv4MFhbaAA4ppmHv0gHMi7s+uI=; b=NrjXAQJTLjea85LBixjSb0JqxEFVdD5lUtvhY9XYIEkFDany0TSjig1/3vOy+Wvuyo 6NRdasykp1Zy0f07nlDgIyIKBnocqvPl5KFTzFnmk9apepZOLO8jPQb3uOJMChjqNHCa WKFe7PzhkKSkYmISx4hyWFsLzTFh7ZdlA902k=
MIME-Version 1.0
Sender chris@rebertia.com
In-Reply-To <201107140818034940258@gmail.com>
References <201107140818034940258@gmail.com>
Date Wed, 13 Jul 2011 18:04:47 -0700
X-Google-Sender-Auth dRemT9ifUHGm_MdaVpTzZtpmfzI
Subject Re: should i install python image library by myself?
From Chris Rebert <clp2@rebertia.com>
To think <thinke365@gmail.com>
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
Cc python-list <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1013.1310605495.1164.python-list@python.org> (permalink)
Lines 43
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1310605495 news.xs4all.nl 23910 [2001:888:2000:d::a6]:35437
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:9454

Show key headers only | View raw


On Wed, Jul 13, 2011 at 5:18 PM, think <thinke365@gmail.com> wrote:
> when i type import image in the python interactive command, i am surprised
> to find that it does not work. the details are as follows:

What led you to expect that exact command would work in the first place??

>>>> import image
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> ImportError: No module named image
>
> i wonder the image library should be a buildin module, then why i cannot
> import it?
> what's wrong? or some version of python does not include image library as a
> buildin module?

There is no standard library module by that name; no first-party
versions of Python include such a module. Thus, it's no surprise that
your import throws an exception.

> so can anybody recommend a version of python which include image libary,

I can only guess that your "image" library refers to either the
"Image" (capitalization matters!) *submodule* of PIL
(http://www.pythonware.com/products/pil/ ), or the "Image" class of
Tkinter (http://docs.python.org/library/tkinter.html#images ).

The former requires installation of PIL, and would then be correctly
imported via:
from PIL import Image

The latter is typically built as part of a default Python installation
and would be correctly imported via:
from Tkinter import Image # Python 2.x
or:
from tkinter import Image # Python 3.x

Cheers,
Chris
--
http://rebertia.com

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: should i install python image library by myself? Chris Rebert <clp2@rebertia.com> - 2011-07-13 18:04 -0700

csiph-web