How to install beautiful soup 4 with python 2.7 on windows

Question:

I have windows vista with Python 2.7. I would like to install BeautifulSoup 4 but apparently I can’t install Beautiful Soup just by copying the file into the site-packages directory.
I have to install pip and then run some commands from the command prompt.
Could you guide me through it step by step?

Asked By: user1119429

||

Answers:

easy_install BeautifulSoup4

or

easy_install BeautifulSoup 

to install easy_install

http://pypi.python.org/pypi/setuptools#files
Answered By: Rakesh

You don’t need pip for installing Beautiful Soup – you can just download it and run python setup.py install from the directory that you have unzipped BeautifulSoup in (assuming that you have added Python to your system PATH – if you haven’t and you don’t want to you can run C:PathToPython27python "C:PathToBeautifulSoupsetup.py" install)

However, you really should install pip – see How to install pip on Windows for how to do that best (via @MartijnPieters comment)

Answered By: Sean Vieira

Install pip

Download get-pip. Remember to save it as “get-pip.py”

Now go to the download folder. Right click on get-pip.py then open with python.exe.

You can add system variable by

(by doing this you can use pip and easy_install without specifying path)

1 Clicking on Properties of My Computer

2 Then chose Advanced System Settings

3 Click on Advanced Tab

4 Click on Environment Variables

5 From System Variables >>> select variable path.

6 Click edit then add the following lines at the end of it

 ;c:Python27;c:Python27Scripts

(please dont copy this, just go to your python directory and copy the paths similar to this)

NB:- you have to do this once only.

Install beautifulsoup4

Open cmd and type

pip install beautifulsoup4
Answered By: Ajeeb.K.P

I feel most people have pip installed already with Python. On Windows, one way to check for pip is to open Command Prompt and typing in:

python -m pip

If you get Usage and Commands instructions then you have it installed.
If python was not found though, then it needs to be added to the path. Alternatively you can run the same command from within the installation directory of python.

If all is good, then this command will install BeautifulSoup easily:

python -m pip install BeautifulSoup4

Screenshot:

Installing very very beautiful soup

N’ now I see I need to upgrade my pip, which I just did 🙂

Answered By: Rani Kheir
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.