By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,798 Members | 1,370 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,798 IT Pros & Developers. It's quick & easy.

Importing module PIL vs beautifulSoup.

P: n/a
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
Share this Question
Share on Google+
3 Replies

P: n/a
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

P: n/a
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

P: n/a
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.