我在没有找到解决方案的情况下阅读了这篇文章:http://docs.python.org/install/index.html
"正常"的方式是:
访问Beautiful Soup网站,http://www.crummy.com/software/BeautifulSoup/
下载包
打开包装
在终端窗口中,cd
到结果目录
类型 python setup.py install
另一种解决方案是使用easy_install
.转到http://peak.telecommunity.com/DevCenter/EasyInstall),使用该页面上的说明安装软件包,然后在终端窗口中键入:
easy_install BeautifulSoup4 # for older v3: # easy_install BeautifulSoup
easy_install
将负责下载,拆包,构建和安装包.使用的优点easy_install
是它知道如何搜索许多不同的Python包,因为它查询PyPI注册表.因此,一旦您使用easy_install
了计算机,就可以通过shell中的一个命令安装许多不同的第三方软件包.
我认为目前正确的做法是pip
像Pramod评论一样
pip install beautifulsoup4
因为Python的最后更改,请参阅此处的讨论.过去并非如此.
Brian也打败了我,但因为我已经有了成绩单:
easy_install的
aaron@ares ~$ sudo easy_install BeautifulSoup Searching for BeautifulSoup Best match: BeautifulSoup 3.0.7a Processing BeautifulSoup-3.0.7a-py2.5.egg BeautifulSoup 3.0.7a is already the active version in easy-install.pth Using /Library/Python/2.5/site-packages/BeautifulSoup-3.0.7a-py2.5.egg Processing dependencies for BeautifulSoup Finished processing dependencies for BeautifulSoup
..或正常的无聊方式:
aaron@ares ~/Downloads$ curl http://www.crummy.com/software/BeautifulSoup/download/BeautifulSoup.tar.gz > bs.tar.gz % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 71460 100 71460 0 0 84034 0 --:--:-- --:--:-- --:--:-- 111k aaron@ares ~/Downloads$ tar -xzvf bs.tar.gz BeautifulSoup-3.1.0.1/ BeautifulSoup-3.1.0.1/BeautifulSoup.py BeautifulSoup-3.1.0.1/BeautifulSoup.py.3.diff BeautifulSoup-3.1.0.1/BeautifulSoupTests.py BeautifulSoup-3.1.0.1/BeautifulSoupTests.py.3.diff BeautifulSoup-3.1.0.1/CHANGELOG BeautifulSoup-3.1.0.1/README BeautifulSoup-3.1.0.1/setup.py BeautifulSoup-3.1.0.1/testall.sh BeautifulSoup-3.1.0.1/to3.sh BeautifulSoup-3.1.0.1/PKG-INFO BeautifulSoup-3.1.0.1/BeautifulSoup.pyc BeautifulSoup-3.1.0.1/BeautifulSoupTests.pyc aaron@ares ~/Downloads$ cd BeautifulSoup-3.1.0.1/ aaron@ares ~/Downloads/BeautifulSoup-3.1.0.1$ sudo python setup.py install running install <... snip ...>