Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin1!goblin2!goblin.stu.neva.ru!newsfeed1.swip.net!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: 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; 'output': 0.05; '-*-': 0.07; 'element': 0.07; 'error:': 0.07; 'problem:': 0.07; "subject:' ": 0.07; 'utf-8': 0.07; 'advice.': 0.09; 'chunk': 0.09; 'coding:': 0.09; 'conf': 0.09; 'makefile': 0.09; 'os.path': 0.09; 'setup.py': 0.09; 'subject:2.7': 0.09; 'subject:How': 0.10; 'windows': 0.15; "'rb')": 0.16; '(it': 0.16; 'build_py': 0.16; 'convey': 0.16; 'fluency': 0.16; 'folder,': 0.16; 'folder.': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'hierarchy.': 0.16; 'message- id:@mrabarnett.plus.com': 0.16; 'programmers,': 0.16; 'received:192.168.1.4': 0.16; 'soup': 0.16; 'subject: \n ': 0.16; 'subject:access': 0.16; 'unpack': 0.16; 'unpacked': 0.16; 'subject:python': 0.16; 'folder': 0.16; 'wrote:': 0.18; 'working.': 0.19; 'import': 0.22; 'install': 0.23; 'header:User- Agent:1': 0.23; 'file.': 0.24; 'looks': 0.24; 'this:': 0.26; 'downloaded': 0.26; 'header:In-Reply-To:1': 0.27; 'testing': 0.29; '(c)': 0.29; '2009': 0.29; 'generally': 0.29; 'directory,': 0.31; 'facility': 0.31; 'file': 0.32; 'running': 0.33; 'copying': 0.34; 'skip:d 20': 0.34; 'but': 0.35; 'version': 0.36; 'ext': 0.36; 'thank': 0.38; 'configured': 0.38; 'follows:': 0.38; 'todo': 0.38; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'hope': 0.61; "you've": 0.63; 're:': 0.63; 'dear': 0.65; 'within': 0.65; 'direct': 0.67; 'latest': 0.67; 'news': 0.67; 'reserved.': 0.68; 'beautiful': 0.68; 'skip:r 30': 0.69; 'cut': 0.74; 'lack': 0.78; '6.1': 0.84; 'crummy': 0.84; 'drive.': 0.84; 'explorer': 0.84; 'extensions.': 0.84; 'ian,': 0.84; 'contents.': 0.91 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=etNRz+ZX c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=0Bzu9jTXAAAA:8 a=1oDRhzKAKukA:10 a=xobXauqK_lgA:10 a=ihvODaAuJD4A:10 a=IkcTkHD0fZMA:10 a=EBOSESyhAAAA:8 a=KYxMASHzgdchMPnSSgsA:9 a=QEXdDO2ut3YA:10 X-AUTH: mrabarnett:2500 Date: Tue, 13 May 2014 15:48:55 +0100 From: MRAB User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: How do I access 'Beautiful Soup' on python 2.7 or 3.4 , console or idle versions. References: <10313d81-01f2-48ed-951c-a5a6cccee65e@googlegroups.com> <7a908d5e-1e0e-4828-a3e0-172df735e6c3@googlegroups.com> <1ade4a7c-833c-44eb-982a-3e17ccbc64b1@googlegroups.com> <7b33a525-58ee-4009-94c4-f9ed69eb3af0@googlegroups.com> <81acc9a1-f3d5-4379-9b29-1be4966f6c35@googlegroups.com> In-Reply-To: <81acc9a1-f3d5-4379-9b29-1be4966f6c35@googlegroups.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 98 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1399992537 news.xs4all.nl 2896 [2001:888:2000:d::a6]:32923 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:71498 On 2014-05-13 12:59, Simon Evans wrote: > Dear Ian, and other programmers, thank you for your advice. > I am resending the last message because this twattish cut and paste facility on my computer has a knack of chopping off ones original message, I will try to convey the right message this time : > > I have removed the original Beautiful Soup 4 download, that I had unzipped to my Beautiful Soup directory on the C drive. > I downloaded the latest version of Beautiful Soup 4 from the Crummy site. > I unzipped it, and removed the contents of the unzipped directory and placed contents in my Beautiful Soup directory, and again had the same output to my console re: > -------------------------------------------------------------------------------- > > Microsoft Windows [Version 6.1.7601] > Copyright (c) 2009 Microsoft Corporation. All rights reserved. > > C:\Users\Intel Atom>cd "c:\Beautiful Soup" > > c:\Beautiful Soup>c:\Python27\python setup.py install > > running install > running build > running build_py > error: package directory 'bs4' does not exist > > > c:\Beautiful Soup> > ------------------------------------------------------------------------------- > I have made a note of all the contents of the downloaded and unzipped BS4,ie the contents of my Beautiful Soup folder on the C drive, which is as follows: > ------------------------------------------------------------------------------- > > running install > running build > running build_py > > error: package directory 'bs4' does not existinit > _html5lib > _htmlparser > _lxml > 6.1 > AUTHORS > conf > COPYING > dammit > demonstration_markup > element > index.rst > Makefile > NEWS > PGK-INFO > README > setup > test_builder_registry > test_docs > test_html5lib > test_htmlparser > text_lxml > test_soup > test_tree > testing > TODO > -------------------------------------------------------------------------------- > I can see no bs4 folder within the contents. > I can not see any setup.py file either, but this is how I downloaded it. > I am only following instructions as suggested. > I do not understand why it is not working. > I hope someone can direct me in the right direction, as I seem to be stuck, and I don't think it has much bearing on my fluency or lack of it with Python. > I think I see your problem: you've unpacked everything into a single folder instead of a folder hierarchy. (It also looks like you have Explorer configured to hide the file extensions. That's generally _not_ recommended.) Try this: #! python3.4 # -*- coding: utf-8 -*- from os.path import splitext import gzip import tarfile # The path of the downloaded file. tar_gz_path = r'C:\beautifulsoup4-4.3.2.tar.gz' # Unpack the .tar.gz file to a .tar file. tar_path, ext = splitext(tar_gz_path) with gzip.open(tar_gz_path, 'rb') as from_file: with open(tar_path, 'wb') as to_file: chunk = from_file.read() to_file.write(chunk) # Unpack the .tar file to a folder. folder, ext = splitext(tar_path) tar = tarfile.open(tar_path) tar.extractall(folder) tar.close()