473,569 Members | 2,782 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Importing module PIL vs beautifulSoup.

I downloaded BeautifulSoup.p y 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\s ite-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 2161
bs*****@gmail.c om wrote:
I downloaded BeautifulSoup.p y 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\s ite-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.p y). 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\s ite-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...@i nvalid.invalid>
wrote:
bsag...@gmail.c om wrote:
I downloaded BeautifulSoup.p y 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\s ite-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.p y). 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\s ite-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...@i nvalid.invalid>
wrote:
bsag...@gmail.c om wrote:
I downloaded BeautifulSoup.p y 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\s ite-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.p y). 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\s ite-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
1981
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 can be inside another table. Is it better and easier to use the pyparsing module or HTMLparser? Thanks for suggestions. La.
12
2364
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 some cases there is a further complication: module importing through an indirect mechanism, like: exec "from " + xxx + " import *". A part the fact...
4
2655
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 piece which holds the programs reference: globals, functions, classes, modules etc. The objects of this file (functions and classes) are directly...
4
3111
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 the page yet). I ran these steps in python to see what was up: >>from BeautifulSoup import BeautifulSoup >>from urllib2 import build_opener,...
7
8582
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 when I start looking for tables I only get tables of depth 1 how do I go about accessing inner tables? same happens for links... this is what I've...
9
1749
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 be done? Thanks in advance.
4
2191
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 re-read Chapter 16 (Module Basics) in Lutz and Ascher's "Learning Python" but it's not working for me. In one module (the "source"),...
7
1592
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 compiled and executed? Only once (the first time the PVM locates, compiles and executes the sys module)? or once for each module importing sys?...
3
1792
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 module, oddmodule.py (below), that defines a variable, OddVariable, by assigning a value A to it. The file I execute, mainfile.py, imports and re-binds...
0
7917
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8118
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6277
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5501
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2105
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.