easy_install 跟 pip 都是 Python 的套件管理程序,有了它们,在使用 Python 开发程序的时候会带來不少方便。
easy_install 和 pip 有什么不一样?据 pip 官网的说法,pip 改善了不少 easy_install 的缺点,如此说來 pip 应该是略胜一筹,不过它还不能够完全取代对方,因为目前有很多套件还是得用 easy_install 安裝。
安装使用easy_install
安装: $ wget -q http://peak.telecommunity.com/dist/ez_setup.py $ python ./ez_setup.py 使用: $ easy_install PackageName #安装套件 $ easy_install -U PackageName #更新套件 $ easy_install -m PackageName #卸载套件 $ easy_install --showhelp #显示说明
安装使用pip
安装: $ easy_install -U setuptools #更新setuptools版本(重要),pip依赖于setuptools $ easy_install pip 使用: $ pip install PackageName #安装套件 $ pip install -U PackageName #更新套件 $ pip uninstall PackageName #卸载套件 $ pip search PackageName #搜索套件 $ pip help #显示说明
=========================================================
2017.05.10更新
$ pip list #查看已安装的Package $ pip --proxy=http://172.22.193.65:3128 install PackageName #pip使用代理
ez_install如果要使用proxy server,需要指定如下环境变量(可以参考这篇文章)
$ export http_proxy=http://172.22.193.65:3128 $ export https_proxy=http://172.22.193.65:3128
Leave a Reply