HOWTO: Install Setuptools in Windows

If you are in the habit of loading third-party modules in Python, you really should check out Setuptools. Setuptools includes all sorts of enhancements to the Python distutils to help developers build and distribute their applications. But most importantly (for me at least), it includes the EasyInstall utility:

Easy Install is a python module (easy_install) bundled with setuptools that lets you automatically download, build, install, and manage Python packages.

Here’s how to install it and make sure it’s working properly…


0. Install Python

Make sure you have Python installed.

1. Download the bootstrap script

Download the bootstrap module (ez_install.py) and save it somewhere on your Windows box. According to the documentation, they recommend not putting it in your Python distribution.

2. Install Setuptools using the script

Open up a console (Start | Run | cmd) and run the script:

C:\Documents and Settings\John\Desktop\ez_setup.py
It will automatically install everything you need.

3. Update your environment variables

Right click the My Computer icon on your desktop and hit Properties. Click the Advanced tab and hit the Environment Variables button near the bottom:


That will bring up the System Variables screen:


Now highlight the Path variable and hit Edit:


Add C:\Python25\Scripts to your Path.

4. Testing and basic usage

Congrats. At this point you should be all set.

If you’d like to test it and/or install a package, just open up a console and use the easy_install command. For example, if you would like to install Paste:

C:\Documents and Settings\John>easy_install Paste

Searching for Paste
Reading http://cheeseshop.python.org/pypi/Paste/
Reading http://pythonpaste.org
Reading http://cheeseshop.python.org/pypi/Paste/1.2.1
Best match: Paste 1.2.1
Downloading http://cheeseshop.python.org/packages/...
Processing Paste-1.2.1.tar.gz
Running Paste-1.2.1\setup.py -q bdist_egg --dist-dir...
Adding paste 1.2.1 to easy-install.pth file

Installed c:\python25\lib\site-packages\paste-1.2.1-py2.5.egg
Processing dependencies for Paste
And just to make sure it worked:

C:\Documents and Settings\John>python
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17)...
...
>>> import paste
That’s it! If you are looking for more modules/packages, check out the Python Cheese Shop. Enjoy!

PS. As a side note, I realized that although you can install PIL via easy_install, it doesn’t seem to import properly. A quick scan of Google makes me think I’m not the only one that had that problem. Not sure what’s up with that.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值