python27 windows 下三种安装第三方库的办法

一、使用easy_install

C:Python27Scripts 下有 easy_install.exe 。例如我要安装 beautifulsoup,可以从 cmd 进入该目录,直接运行:

easy_install beautifulsoup4

卸载库,可以用:

easy_install -m beautifulsoup4 卸载所有依赖项

然后删掉包目录下方的 .egg 文件

更新包:

easy_install --upgrade beautifulsoup4

二、使用 pip (推荐)

pip install beautifulsoup4

pip uninstall beautifulsoup4

三、源码安装

下载函数库,解压,移动到 C:Python27Libsite-packages 下,从cmd 进入函数库文件夹,运行:

python setup.py build

python setup.py install

删除所安装的包,直接删除文件就好

原文地址:https://www.cnblogs.com/yinxiangnan-charles/p/5624798.html