Importing module PIL vs beautifulSoup.

B

bsagert

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.
 
B

bsagert

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.





Did you try "import PIL"? All module and package names in Python are case
sensitive.
 
B

bsagert

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.





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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top