noob's install

964 views
Skip to first unread message

datafunk

unread,
Aug 31, 2011, 5:30:55 PM8/31/11
to beauti...@googlegroups.com
Hi there,

I am having problems installing BS - first tried 3.2 and now bs4 (i got heaps further with bs4 though) and here's what I get:

>>> from bs4 import BeautifulSoup
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python32\lib\bs4\__init__.py", line 56
    ROOT_TAG_NAME = u'[document]'
                                ^
SyntaxError: invalid syntax

what do I do wrong?

Leonard Richardson

unread,
Sep 1, 2011, 10:39:03 AM9/1/11
to beauti...@googlegroups.com

I don't know. What version of Python are you running?

Leonard

datafunk

unread,
Sep 1, 2011, 8:43:25 PM9/1/11
to beauti...@googlegroups.com
Hi Leonard,

I was using 3.2, but now I installed python2.6 and it seems to work.
I got a bit confused about versionining: when you refer to BS version or Python version on http://www.crummy.com/software/BeautifulSoup/ 
So I guess it was an issue that python 3.x is not supported - is that right?

Thanks for your response,
Peter

Leonard Richardson

unread,
Sep 1, 2011, 10:13:12 PM9/1/11
to beauti...@googlegroups.com
> I was using 3.2, but now I installed python2.6 and it seems to work.
> I got a bit confused about versionining: when you refer to BS version or
> Python version on http://www.crummy.com/software/BeautifulSoup/
> So I guess it was an issue that python 3.x is not supported - is that right?

Yeah, BS4 should work on Python 3, but that doesn't look like the
version you had installed. How did you install it? Did you use
setup.py or just copy the files? The files as they are in the tarball
are Python 2, and they need to be converted to Python 3 code (which
setup.py does) to work with Python 3.

Leonard

datafunk

unread,
Sep 2, 2011, 1:27:26 AM9/2/11
to beauti...@googlegroups.com
I played around with bs4 as well and finally I got the old version going with python 2.6
Yes I just copied the files,but then run setup.py - I have to get my head around the proper way to install modules - something that may be contributing to my troubles. do you know a noobies guide that would run me through how to install libraries for python (windows) in general?

Thomas Kluyver

unread,
Oct 11, 2011, 1:12:48 PM10/11/11
to beautifulsoup
In general, download the module, unzip it, open a command line to the
folder it unzipped to, and run "python setup.py install". This is
easier on Linux/Mac systems, but you can get an "Open command window
here" plugin for Windows that helps.

Some Python modules produce an executable installer for Windows, but
it doesn't look like BeautifulSoup has that.

Vladimir Brodskiy

unread,
Nov 7, 2011, 6:39:56 AM11/7/11
to beautifulsoup
So sorry, I'm python noob, but I have trouble when I try install under
the Windows
I download last version of Python:Python 3.2.2 (default, Sep 4 2011,
09:51:08) and beautifulsoup, but when I run "python setup.py install"
I see:

E:\tmp\BS>python setup.py install
File "setup.py", line 22
print "Unit tests have failed!"
^
SyntaxError: invalid syntax

What I do wrong? Thank you!

Jake Sopher

unread,
Nov 8, 2011, 5:56:59 AM11/8/11
to beauti...@googlegroups.com
try downloading python 2.7
--------

http://about.me/jesopher

> --
> You received this message because you are subscribed to the Google Groups "beautifulsoup" group.
> To post to this group, send email to beauti...@googlegroups.com.
> To unsubscribe from this group, send email to beautifulsou...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/beautifulsoup?hl=en.
>
>

Thomas Kluyver

unread,
Nov 18, 2011, 9:44:28 AM11/18/11
to beautifulsoup
Vladimir, to use BeautifulSoup with Python 3, you must get the beta
release of BS 4.

Thomas
Reply all
Reply to author
Forward
0 new messages