python自动安装工具easy_install的使用
2012-05-18 15:37
851 查看
Python中的easy_install工具很爽,它的作用类似于Php中的pear,或者Ruby中的gem,或者Perl中的cpan。
如果想使用easy_install工具,可能需要先安装setuptools,不过更酷的方法是使用ez_setup.py脚本:
wget -q http://peak.telecommunity.com/dist/ez_setup.py
python ez_setup.py
安装完后,最好确保easy_install所在目录已经被加到PATH环境变量里:
Windows: C:\Python25\Scripts
Linux: /usr/local/bin
安装easy_install完成之后,如何使用easy_install呢,去官网看看吧:--Downloading and Installing a Package
使用一:
根据你想要的安装包名来进行easy_install,工具会检索网页查询最新版本的包,自动下载、构建和安装
easy_install SQLObject
这办法很简洁并不适合中国国情,由于GFW对python.org的长期屏蔽,命令行下的easy_install根本找不到网址,更无从下载
使用二:
指定网址来更新或安装,类似使用一,多了个参数-f和用来指定页面的地址
只指定页面地址
easy_install -f http://pythonpaste.org/package_index.html SQLObject
使用三:
只使用网址来easy_install安装
easy_install http://example.com/path/to/MyPackage-1.2.3.tgz
使用四
easy_install安装下载好的egg文件(egg文件是用setup tools打包的压缩文件)
easy_install /my_downloads/OtherPackage-3.2.1-py2.3.egg
使用五:
升级包,有时候你需要更新包的版本
easy_install --upgrade PyProtocols
使用六:
我最喜欢的一种方法,翻*墙后下载安装包并解压,然后CD到解压包内运行以下命令即可
easy_install .
可以指定版本:
easy_install "MySQL-python==1.2.2"
参考资料:http://peak.telecommunity.com/DevCenter/EasyInstall#downloading-and-installing-a-package
如果想使用easy_install工具,可能需要先安装setuptools,不过更酷的方法是使用ez_setup.py脚本:
wget -q http://peak.telecommunity.com/dist/ez_setup.py
python ez_setup.py
安装完后,最好确保easy_install所在目录已经被加到PATH环境变量里:
Windows: C:\Python25\Scripts
Linux: /usr/local/bin
安装easy_install完成之后,如何使用easy_install呢,去官网看看吧:--Downloading and Installing a Package
使用一:
根据你想要的安装包名来进行easy_install,工具会检索网页查询最新版本的包,自动下载、构建和安装
easy_install SQLObject
这办法很简洁并不适合中国国情,由于GFW对python.org的长期屏蔽,命令行下的easy_install根本找不到网址,更无从下载
使用二:
指定网址来更新或安装,类似使用一,多了个参数-f和用来指定页面的地址
只指定页面地址
easy_install -f http://pythonpaste.org/package_index.html SQLObject
使用三:
只使用网址来easy_install安装
easy_install http://example.com/path/to/MyPackage-1.2.3.tgz
使用四
easy_install安装下载好的egg文件(egg文件是用setup tools打包的压缩文件)
easy_install /my_downloads/OtherPackage-3.2.1-py2.3.egg
使用五:
升级包,有时候你需要更新包的版本
easy_install --upgrade PyProtocols
使用六:
我最喜欢的一种方法,翻*墙后下载安装包并解压,然后CD到解压包内运行以下命令即可
easy_install .
可以指定版本:
easy_install "MySQL-python==1.2.2"
参考资料:http://peak.telecommunity.com/DevCenter/EasyInstall#downloading-and-installing-a-package
相关文章推荐
- python 自动安装工具 setuptools(easy_install) 的使用
- python自动安装工具easy_install的使用
- python自动安装工具easy_install的使用
- 安装Python 包自动安装工具 easy_install 和pip
- linux环境python安装setuptools(使用easy_install)的必要条件
- Python easy_install工具安装
- Python_使用easy_install工具源码
- python easy_install的安装 以及使用
- python - easy_install的安装和使用
- Python使用easy-install安装时报UnicodeDecodeError的解决方法
- python - easy_install的安装和使用
- Python中easy_install 和 pip 的安装及使用
- easy_install的安装和使用(Python基础)
- 安装Python的easy_install工具和BeautifulSoup模块
- python easy_install 的简单安装和使用
- Python包管理工具easy_install安装
- linux python工具pip和 easy_install的安装
- python使用easy_install安装支持excel2007操作的openpyxl
- python - easy_install的安装和使用
- python - easy_install的安装和使用