views:

81

answers:

3

I am using beautifulsoup, and I am getting some htmlparser errors with start tags etc.

I read on crummy's site that one suggestion is to go back to an older version (3.08).

I am using Ubuntu, where I did:

sudo apt-get install python-beautifulsoup

to install it.

  1. how can I check what version I have now?
  2. how can I force a specific version using apt-get? (and how to uninstall what I have now)

thanks (i'm newish to ubuntu)

latest version of ubuntu 10.04

+2  A: 

i run in the same problem on mac osx 10.5 and i removed the current version of beautiful soup with

sudo apt-get remove python-beautifulsoup

then i installed 3.0.7 from this address and all is now working fine.

To know the current version of you module:

import BeautifulSoup
print BeautifulSoup.__version__
Mermoz
but how can I install it using apt-get?
Blankman
you may try: apt-get -v 3.0.7 but i doubt it will work (that would mean that the apt-get repository has a reference of all the versions)however installing a package from a dowload is fairly simple and reliable (if dependencies is what you fear):unpack,cd to the directory and sudo python setup.py install
Mermoz
@Mermoz thanks that worked.
Blankman
A: 

Answer to your first question: at your shell prompt, type

python -c "import BeautifulSoup as bs; print(bs.__version__)"
John Machin
A: 

For your first question:

import BeautifulSoup
BeautifulSoup.__version__

And for the second:

You can't. Maybe you should use easy_install or pip instead.

Satoru.Logic