472,354 Members | 1,895 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,354 software developers and data experts.

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 2074
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Lad | last post by:
I came across pyparsing module by Paul McGuire. It seems to be nice but I am not sure if it is the best for my need. I need to extract some text from html page. The text is in tables and a table...
12
by: qwweeeit | last post by:
The pythonic way of programming requires, as far as I know, to spread a big application in plenty of more manageable scripts, using import or from ... import to connect the various modules. In...
4
by: jean-marc | last post by:
As an application programmer, I'm not well versed in the material aspects of computing (memory, cpu, bus and all). My understanding of imports in Python is such: the __main__ program is the center...
4
by: Steve Young | last post by:
I tried using BeautifulSoup to make changes to the url links on html pages, but when the page was displayed, it was garbled up and didn't look right (even when I didn't actually change anything on...
7
by: Gonzillaaa | last post by:
I'm trying to get the data on the "Central London Property Price Guide" box at the left hand side of this page http://www.findaproperty.com/regi0018.html I have managed to get the data :) but...
9
by: Mizipzor | last post by:
Is there a way to "subscribe" to individual topics? im currently getting bombarded with daily digests and i wish to only receive a mail when there is activity in a topic that interests me. Can this...
4
by: rshepard | last post by:
I'm stymied by what should be a simple Python task: accessing the value of a variable assigned in one module from within a second module. I wonder if someone here can help clarify my thinking. I've...
7
by: Hussein B | last post by:
Hey, Suppose I have a Python application consists of many modules (lets say it is a Django application). If all the modules files are importing sys module, how many times the sys module will be...
3
by: rs387 | last post by:
Hi, I've found the following behaviour on importing a variable from a module somewhat odd. The behaviour is identical in Python 2.5 and 3.0b2. In summary, here's what happens. I have a...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made but the http to https rule only works for...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. header("Location:".$urlback); Is this the right layout the...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.