[Tutor] trouble with beautiful soup

marcus lütolf marcus.luetolf at bluewin.ch
Mon Dec 28 12:24:45 EST 2015


Dear Pythonistas
Hi Danny,

I am grateful for your precise instruchtions.
Yes ideed, I tried all of the steps mentioned below which I shoudn't have done fumling around with this task now  for hours and days.
I even tried to do it on may laptop using W7 64bit and after deleting and reinstalling Python27.
The youtube video  I was referring to was : https://www.youtube.com/watch?v=0snOcBQ3I0g.

Now for pip: I found pip in C:\Python27\Lib\site-packages. But if I type in pip or pip.exe I get (in german): The command "pip" is  either typed wrong or could not be found (I can't cut and paste from the command window).
As you might have noticed English is not my natural language and this can lead sometimes to interpretation errors.

Regards, Marcus.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-----Ursprüngliche Nachricht-----
Von: Danny Yoo [mailto:dyoo at hashcollision.org] 
Gesendet: Samstag, 26. Dezember 2015 22:00
An: marcus lütolf <marcus.luetolf at bluewin.ch>
Cc: python mail list <tutor at python.org>
Betreff: Re: [Tutor] trouble with beautiful soup

On Sat, Dec 26, 2015 at 3:23 AM, marcus lütolf <marcus.luetolf at bluewin.ch> wrote:
> Hi Walter, dear pythonistas,
>
> thank you !
> replacing „beautifulsoup“ by „bs4“ in my code (2nd line) does not relieve the trace back I get.
>
>
>
> In my directory C:\Python27\Lib I find the folder 
> „beautifulsoup4-4-4-1“ in first place and the file „setup.py“ further 
> down
>
> Upon opening „beautifulsoup4-4-4-1“,  „bs4“ appears as another folder among others and some  .py files.
>
> (C:\Python27\Lib\beautifoulsoup4-4-4-1\bs4\)


Ah.  This looks incorrect.  It appears that somehow the contents of the zip file was directly copied into Python27\Lib.  This will not work because the directory layout structure of the zip file includes much more than what Python needs.  The zip file is structurally organized so that you need to follow a specific procedure to install the library.


To be clear: you should *not* be trying to directly copy files into Python27\Lib.  Trying to do it by hand is error-prone, as you are finding.


Please respond to Alan Gauld's recent response, where he said:

    Which command line are you using? The pip command is not a python command but a shell one. You need to run it from the CMD prompt.

    Did you try that? and if so what exact message did you get? Can you show us a cut n paste of the session please?


Please respond to this, because it is crucial to understand what you have done.  I don't think you've actually followed the earlier instructions to run 'python setup.py install' at the Windows command prompt.



> 2 days ago I watched a youtube video about installing beautifulsoup. There, the bs4 folder appeared direct in the Lib folder :
>
> C:\Python27\Lib\bs4\.
>
> Could this cause my trouble ?

The structure here is what I would have expected.  I strongly suggest you try reinstalling the bs4 library by carefully following the installation instructions.


---

By the way, as a meta-comment: please try to refer with explicit hyperlinks if you talk about an external resource such as a YouTube video.  When you mention "I watched a YouTube video about ...", then it's very helpful if you can mention the specific hyperlink to that video.  Here is one reason why it's helpful: it allows one of us to confirm your observation.  Perhaps you might have misunderstood what the video was showing?

Without references, we're at the mercy of hearsay.  Misinterpreting what we observe is a common mistake that all of us humans make.
(This is not limited just in the programming domain, of course.) Rather than ignore that human weakness, we can and should try to anticipate and compensate.  By pointing with references, we allow others to confirm our observations independently.  This is why
references are so important.   Reference-friendly systems like the WWW
are under-appreciated treasures.

---


Hope that makes sense.  Good luck to you!


---
Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft.
https://www.avast.com/antivirus



More information about the Tutor mailing list