Python如何安装模块
以安装Beautifulsoup4为例:
1.到网站上下载:http://www.crummy.com/software/BeautifulSoup/bs4/download/
2.解压文件到C:\Python27
3.cmd运行C:\Python27\BeautifulSoup>python setup.py install
4.测试一下是否能导入:
>>> import bs4
如果不能导入,会提示:ImportError: No module named bs4
如果是之前的程序的话:
改为:
from bs4 import BeautifulSoup