469,955 Members | 1,446 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,955 developers. It's quick & easy.

Importing module PIL vs beautifulSoup.

I downloaded BeautifulSoup.py from http://www.crummy.com/software/BeautifulSoup/
and being a n00bie, I just placed it in my Windows c:\python25\lib\
file. When I type "import beautifulsoup" from the interactive prompt
it works like a charm. This seemed too easy in retrospect.

Then I downloaded the PIL (Python Imaging Library) module from
http://www.pythonware.com/products/pil/. Instead of a simple file that
BeautifulSoup sent me, PIL is an .exe that installed itself in c:
\python25\lib\site-packages\PIL\. However it won't load by typing
"import pil".

I know I am supposed to RTFM, but a Google search has not led to the
holy grail that Monty Python found. I realize that PIL is a package as
opposed to a simple script (and it does not include a readme file).
Thanks in advance for any help.
Jun 27 '08 #1
3 2006
bs*****@gmail.com wrote:
I downloaded BeautifulSoup.py from
http://www.crummy.com/software/BeautifulSoup/ and being a n00bie, I
just placed it in my Windows c:\python25\lib\ file. When I type
"import beautifulsoup" from the interactive prompt it works like a
charm. This seemed too easy in retrospect.
It might be better if you put the file in \python25\lib\site-packages\
The same import will still work, but you probably want to avoid putting
non-core files directly in \python25\lib.

Also, it sounds like you renamed the file: "import beautifulsoup" should
fail (the file is supposed to be called BeautifulSoup.py). If you want to
be able to install other software which has been written to use
BeautifulSoup you'll need to make sure the case of the filename is correct.
>
Then I downloaded the PIL (Python Imaging Library) module from
http://www.pythonware.com/products/pil/. Instead of a simple file that
BeautifulSoup sent me, PIL is an .exe that installed itself in c:
\python25\lib\site-packages\PIL\. However it won't load by typing
"import pil".

I know I am supposed to RTFM, but a Google search has not led to the
holy grail that Monty Python found. I realize that PIL is a package as
opposed to a simple script (and it does not include a readme file).
Thanks in advance for any help.
Did you try "import PIL"? All module and package names in Python are case
sensitive.
Jun 27 '08 #2
On Jun 18, 10:18 am, Duncan Booth <duncan.bo...@invalid.invalid>
wrote:
bsag...@gmail.com wrote:
I downloaded BeautifulSoup.py from
http://www.crummy.com/software/BeautifulSoup/and being a n00bie, I
just placed it in my Windows c:\python25\lib\ file. When I type
"import beautifulsoup" from the interactive prompt it works like a
charm. This seemed too easy in retrospect.

It might be better if you put the file in \python25\lib\site-packages\
The same import will still work, but you probably want to avoid putting
non-core files directly in \python25\lib.

Also, it sounds like you renamed the file: "import beautifulsoup" should
fail (the file is supposed to be called BeautifulSoup.py). If you want to
be able to install other software which has been written to use
BeautifulSoup you'll need to make sure the case of the filename is correct.
Then I downloaded the PIL (Python Imaging Library) module from
http://www.pythonware.com/products/pil/. Instead of a simple file that
BeautifulSoup sent me, PIL is an .exe that installed itself in c:
\python25\lib\site-packages\PIL\. However it won't load by typing
"import pil".
I know I am supposed to RTFM, but a Google search has not led to the
holy grail that Monty Python found. I realize that PIL is a package as
opposed to a simple script (and it does not include a readme file).
Thanks in advance for any help.

Did you try "import PIL"? All module and package names in Python are case
sensitive.
Jun 27 '08 #3
On Jun 18, 10:18 am, Duncan Booth <duncan.bo...@invalid.invalid>
wrote:
bsag...@gmail.com wrote:
I downloaded BeautifulSoup.py from
http://www.crummy.com/software/BeautifulSoup/and being a n00bie, I
just placed it in my Windows c:\python25\lib\ file. When I type
"import beautifulsoup" from the interactive prompt it works like a
charm. This seemed too easy in retrospect.

It might be better if you put the file in \python25\lib\site-packages\
The same import will still work, but you probably want to avoid putting
non-core files directly in \python25\lib.

Also, it sounds like you renamed the file: "import beautifulsoup" should
fail (the file is supposed to be called BeautifulSoup.py). If you want to
be able to install other software which has been written to use
BeautifulSoup you'll need to make sure the case of the filename is correct.
Then I downloaded the PIL (Python Imaging Library) module from
http://www.pythonware.com/products/pil/. Instead of a simple file that
BeautifulSoup sent me, PIL is an .exe that installed itself in c:
\python25\lib\site-packages\PIL\. However it won't load by typing
"import pil".
I know I am supposed to RTFM, but a Google search has not led to the
holy grail that Monty Python found. I realize that PIL is a package as
opposed to a simple script (and it does not include a readme file).
Thanks in advance for any help.

Did you try "import PIL"? All module and package names in Python are case
sensitive.
YIKES, Python is case sensitive! I knew that, says he blushing. Now it
works. Thanks Duncan. Ciao, Bill
Jun 27 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Lad | last post: by
12 posts views Thread by qwweeeit | last post: by
4 posts views Thread by jean-marc | last post: by
4 posts views Thread by Steve Young | last post: by
7 posts views Thread by Gonzillaaa | last post: by
9 posts views Thread by Mizipzor | last post: by
7 posts views Thread by Hussein B | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.