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 that step by step. I am really a noob so make it very simple. Thanks in advance
相关问题
- Views base64 encoded blob in HTML with PHP
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
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
(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
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:
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:
Screenshot:
N' now I see I need to upgrade my pip, which I just did :)
or
to install easy_install
You don't need
pip
for installing Beautiful Soup - you can just download it and runpython setup.py install
from the directory that you have unzipped BeautifulSoup in (assuming that you have added Python to your systemPATH
- if you haven't and you don't want to you can runC:\Path\To\Python27\python "C:\Path\To\BeautifulSoup\setup.py" install
)However, you really should install
pip
- see How to install pip on Windows for how to do that best (via @MartijnPieters comment)