安装和使用python的setup tools

安装Twisted时需要装zope.interface模块,下载后发现是egg的,不知咋装,网上找发现setup tools。下面记录。

安装setup tools:
下载文件:ez_setup.py

然后使用2.6的解释器执行,这个脚本会自动在网上去下载相关的安装程序,然后就安装好了,安装完成后,会在scripts文件下生成几个exe可执行文件。

C:\>c:\Python26\python.exe ez_setup.py
Downloading http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c11-p
y2.6.egg
Processing setuptools-0.6c11-py2.6.egg
Copying setuptools-0.6c11-py2.6.egg to c:\python26\lib\site-packages
Adding setuptools 0.6c11 to easy-install.pth file
Installing easy_install-script.py script to c:\Python26\Scripts
Installing easy_install.exe script to c:\Python26\Scripts
Installing easy_install.exe.manifest script to c:\Python26\Scripts
Installing easy_install-2.6-script.py script to c:\Python26\Scripts
Installing easy_install-2.6.exe script to c:\Python26\Scripts
Installing easy_install-2.6.exe.manifest script to c:\Python26\Scripts

Installed c:\python26\lib\site-packages\setuptools-0.6c11-py2.6.egg
Processing dependencies for setuptools==0.6c11
Finished processing dependencies for setuptools==0.6c11


使用 setuptools:

语法:easy_install.exe 你要安装的egg包

注意egg包不一定是扩展名是egg的,其实在linux里面是不区分扩展名的。后面的egg包也可以是网址的。如果你非常懒,像我jason懒羊羊那么懒的话,直接输入名称就可以了。比如你要安装Mechanize模块,只要输入:easy_install Mechanize 就可以啦,剩下来的工作setuptools会帮你搞定的。


下载zope.interface-3.6.1-py2.6-win32.egg放到C:\Python26\Scripts目录下,然后

C:\>cd Python26\Scripts
C:\Python26\Scripts>easy_install.exe zope.interface-3.6.1-py2.6-win32.egg
Processing zope.interface-3.6.1-py2.6-win32.egg
creating c:\python26\lib\site-packages\zope.interface-3.6.1-py2.6-win32.egg
Extracting zope.interface-3.6.1-py2.6-win32.egg to c:\python26\lib\site-packages

Adding zope.interface 3.6.1 to easy-install.pth file

Installed c:\python26\lib\site-packages\zope.interface-3.6.1-py2.6-win32.egg
Processing dependencies for zope.interface==3.6.1
Finished processing dependencies for zope.interface==3.6.1

C:\Python26\Scripts>

点这里下载附件(ez_setup.py)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值