Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #71344

Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.

Path csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'win32': 0.03; 'syntax': 0.04; '(of': 0.07; "subject:' ": 0.07; 'tries': 0.07; 'indicates': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'setup.py': 0.09; 'subject:2.7': 0.09; 'url:software': 0.09; 'subject:How': 0.10; 'python': 0.11; 'jan': 0.12; '2.7': 0.14; '"unit': 0.16; 'expecting': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'skipping': 0.16; 'soup': 0.16; 'subject: \n ': 0.16; 'subject:access': 0.16; 'syntaxerror:': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'typing': 0.19; '>>>': 0.22; 'import': 0.22; 'tests': 0.22; 'print': 0.22; 'install': 0.23; 'installation': 0.23; 'header:User-Agent:1': 0.23; '2.x': 0.24; 'directory.': 0.24; 'mon,': 0.24; '---': 0.24; 'this:': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply- To:1': 0.27; 'installed': 0.27; 'chris': 0.29; 'am,': 0.29; 'skip:( 20': 0.30; '3.x': 0.31; 'default,': 0.31; 'doc': 0.31; 'go.': 0.31; 'implicit': 0.31; 'trivial': 0.31; 'file': 0.32; 'running': 0.33; 'skip:d 20': 0.34; 'there': 0.35; 'version': 0.36; 'installing': 0.36; 'entry': 0.36; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'does': 0.39; '12,': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'skip:u 10': 0.60; 'received:173': 0.61; "you've": 0.63; '(that': 0.65; 'latest': 0.67; 'mar': 0.68; 'beautiful': 0.68; 'invalid': 0.68; 'default': 0.69; 'below.': 0.71; 'online': 0.71; '2014,': 0.84; 'received:fios.verizon.net': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Terry Reedy <tjreedy@udel.edu>
Subject Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions.
Date Sun, 11 May 2014 16:31:37 -0400
References <10313d81-01f2-48ed-951c-a5a6cccee65e@googlegroups.com> <7a908d5e-1e0e-4828-a3e0-172df735e6c3@googlegroups.com> <CAPTjJmpjiGfXsuLCsPHL7FDTWFLmMqW27fzdcks9z_2_6pNrWg@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host pool-173-75-254-207.phlapa.fios.verizon.net
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0
In-Reply-To <CAPTjJmpjiGfXsuLCsPHL7FDTWFLmMqW27fzdcks9z_2_6pNrWg@mail.gmail.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.9896.1399840324.18130.python-list@python.org> (permalink)
Lines 62
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1399840324 news.xs4all.nl 2966 [2001:888:2000:d::a6]:46170
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:71344

Show key headers only | View raw


On 5/11/2014 3:17 PM, Chris Angelico wrote:
> On Mon, May 12, 2014 at 5:05 AM, Simon Evans <musicalhacksaw@yahoo.co.uk> wrote:

>> c:\Beautiful Soup>python setup.py install.

There is no need for a standalone Beautiful Soup directory. See below.

>>    File "setup.py", line 22
>>      print "Unit tests have failed!"
>>                                    ^
>> SyntaxError: invalid syntax
>
> This indicates that you've installed a 3.x version of Python as the
> default, and setup.py is expecting a 2.x Python. Do you have multiple
> Pythons installed? Try typing this:
>
> c:\Python27\python setup.py install
>
> (That will work only if you have Python 2.7 installed into the default
> location.)

Please do not advise people to unnecessarily downgrade to 2.7 ;-).
Simon just needs the proper current version of BeautifulSoup.
BeautifulSoup3 does not work with 3.x.
BeautifulSoup4 works with 2.6+ and 3.x.
http://www.crummy.com/software/BeautifulSoup/
Installation (of the latest version on PyPI) is trivial with 3.4:

C:\Programs\Python34>pip install beautifulsoup4
Downloading/unpacking beautifulsoup4
   Running setup.py 
(path:C:\Users\Terry\AppData\Local\Temp\pip_build_Terry\beautifulsoup4\setup.py) 
egg_info for package
  beautifulsoup4

Installing collected packages: beautifulsoup4
   Running setup.py install for beautifulsoup4
     Skipping implicit fixer: buffer
     Skipping implicit fixer: idioms
     Skipping implicit fixer: set_literal
     Skipping implicit fixer: ws_comma

Successfully installed beautifulsoup4
Cleaning up...
---

Adding the '4' is necessary as
 >pip install beautifulsoup tries to install beautifulsoup3 as a py3.4 
package and that fails with the SyntaxError message Simon got.

With '4', there is now an entry in lib/site-packages you are ready to go.

Python 3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:25:23) [MSC v.1600 64 
bit (AMD64)] on win32

 >>> from bs4 import BeautifulSoup  # from the bs4 online doc
 >>> BeautifulSoup
<class 'bs4.BeautifulSoup'>

-- 
Terry Jan Reedy

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Simon Evans <musicalhacksaw@yahoo.co.uk> - 2014-05-10 09:58 -0700
  Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Chris Angelico <rosuav@gmail.com> - 2014-05-11 03:03 +1000
  Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Terry Reedy <tjreedy@udel.edu> - 2014-05-10 14:39 -0400
  Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Chris Angelico <rosuav@gmail.com> - 2014-05-11 09:23 +1000
  Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Dave Angel <d@davea.name> - 2014-05-10 22:16 -0400
  Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Simon Evans <musicalhacksaw@yahoo.co.uk> - 2014-05-11 12:05 -0700
    Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Chris Angelico <rosuav@gmail.com> - 2014-05-12 05:17 +1000
      Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Simon Evans <musicalhacksaw@yahoo.co.uk> - 2014-05-11 13:03 -0700
        Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. MRAB <python@mrabarnett.plus.com> - 2014-05-11 21:19 +0100
    Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Terry Reedy <tjreedy@udel.edu> - 2014-05-11 16:31 -0400
      Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Simon Evans <musicalhacksaw@yahoo.co.uk> - 2014-05-11 15:03 -0700
        Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. MRAB <python@mrabarnett.plus.com> - 2014-05-11 23:10 +0100
          Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Simon Evans <musicalhacksaw@yahoo.co.uk> - 2014-05-11 16:19 -0700
            Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Simon Evans <musicalhacksaw@yahoo.co.uk> - 2014-05-11 16:22 -0700
              Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Simon Evans <musicalhacksaw@yahoo.co.uk> - 2014-05-11 16:37 -0700
            Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Ian Kelly <ian.g.kelly@gmail.com> - 2014-05-11 17:47 -0600
              Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Simon Evans <musicalhacksaw@yahoo.co.uk> - 2014-05-12 09:35 -0700
                Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Simon Evans <musicalhacksaw@yahoo.co.uk> - 2014-05-12 12:17 -0700
                Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Ian Kelly <ian.g.kelly@gmail.com> - 2014-05-12 16:54 -0600
                Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Simon Evans <musicalhacksaw@yahoo.co.uk> - 2014-05-13 04:52 -0700
                Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Simon Evans <musicalhacksaw@yahoo.co.uk> - 2014-05-13 04:59 -0700
                Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-05-13 14:23 +0100
                Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. MRAB <python@mrabarnett.plus.com> - 2014-05-13 15:48 +0100
                Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Simon Evans <musicalhacksaw@yahoo.co.uk> - 2014-05-14 12:28 -0700
                Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Ian Kelly <ian.g.kelly@gmail.com> - 2014-05-14 13:33 -0600
                Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Chris Angelico <rosuav@gmail.com> - 2014-05-15 05:36 +1000
                Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Simon Evans <musicalhacksaw@yahoo.co.uk> - 2014-05-15 02:22 -0700
                Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Simon Evans <musicalhacksaw@yahoo.co.uk> - 2014-05-15 04:25 -0700
                Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Simon Evans <musicalhacksaw@yahoo.co.uk> - 2014-05-15 04:30 -0700
                Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Dave Angel <davea@davea.name> - 2014-05-15 08:12 -0400
                Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Rustom Mody <rustompmody@gmail.com> - 2014-05-15 05:17 -0700
                Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Ian Kelly <ian.g.kelly@gmail.com> - 2014-05-13 10:33 -0600
                Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Simon Evans <musicalhacksaw@yahoo.co.uk> - 2014-05-14 11:58 -0700
                Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Ian Kelly <ian.g.kelly@gmail.com> - 2014-05-14 13:30 -0600
                Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-05-13 20:08 +0100
            Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Ian Kelly <ian.g.kelly@gmail.com> - 2014-05-11 18:02 -0600
              Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Simon Evans <musicalhacksaw@yahoo.co.uk> - 2014-05-12 09:02 -0700
        Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Terry Reedy <tjreedy@udel.edu> - 2014-05-11 19:49 -0400
          Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Simon Evans <musicalhacksaw@yahoo.co.uk> - 2014-05-12 09:17 -0700
    Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Chris Angelico <rosuav@gmail.com> - 2014-05-12 11:40 +1000
  Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Rustom Mody <rustompmody@gmail.com> - 2014-05-11 19:47 -0700
    Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. Simon Evans <musicalhacksaw@yahoo.co.uk> - 2014-05-12 09:23 -0700

csiph-web