[Tutor] trouble with beautiful soup

Walter Prins wprins at gmail.com
Fri Dec 25 15:28:14 EST 2015


Hi

On 25 December 2015 at 12:32, marcus lütolf <marcus.luetolf at bluewin.ch>
wrote:

> dear pythonistas, dear contributors Danny and Walter,
>
> I tried all instructions given to my without any success:
> If I type the install commands in the command line - even after having
> installed pip - I invariably get the notion that beautifulsoup is not found.
> If I run the directory C:\Python27\Lib, beautifulsoup is not listed, also
> not if I look into IDLE Python 27/ Open Module.
> And without surprise the command
>
> C:\Python27>python
> Python 2.7.10 (default, May 23 2015, 09:40:32) [MSC v.1500 32 bit (Intel)]
> on win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import BeautifulSoup
>
> returns ...no module found.
>
> On the other hand I find listed
> beautifulsoup4-4.4.1 in IDLE Python 27/ Lib   and
> pip  in IDLE Python 27/Lib/site-packages.
>
>
The above implies you have BeautifulSoup 4 installed.

As mentioned previously, for BeautifulSoup 4, the package name is "bt4", so
you would do

import bt4

to test it.

Only if you have BeautifulSoup 3.x installed, would "import BeautifulSoup"
work.

What exactly is output by pip when you run (from a cmd.exe command shell
window):

pip install beautifulsoup

?

Cheers

Walter


More information about the Tutor mailing list