Archive for the ‘development’ Category

distutils, easy_install, pip

January 14, 2011 1 comment

i love Python ‘s agility. Like Perl and other prestigious communities, there are bunch of cool stuff about Python.

If you spend more and more time in writing Python code and you’re the person who is kinda lazy to reinvent the wheel, you probably resort to googling some existing stuff. And, the result is usually you can find something suitable. However, you have to install non-standard packages. Compared with compiling c/c++ for your Linux distro, installing python requires much less effort in usual cases. Before knowing pypi/easy_install, I installed new packages mostly through apt-get. This is convenient, however you don’t usually get the fresh meat. With distutils, easy_install and pypi, you will be at the cutting edge of Python community.

distutils, the original package provided by python without dependencies management. If you get an install package created with distutils, you can install the package by running “python install” (usually you need root privilege).

setuptools, an updated and network powered distutils. To install a package created by setuptools, you just install the package by running “python install” like distutils. The installation will first check if your machine have setuptools environment. If there is not the environment, it will be installed through a small bootstrap file ( ) contained in the package. Finally, the package will be installed through easy_install of the setuptools. easy_install like apt-get in ubuntu, you can install packages hosted in PyPI (Python Package Index). For more stuff, check the article [1].

pip, is a replacement of easy_install. It has more options like ‘uninstall’. pip can be installed through “easy_install install pip”. There is an interesting article discussing about pip and setuptools [2]. The author said in the end:

So my recommendation is that you run, not walk, over to pip, then forget about setuptools and easy_install.


  1. Hatch Python eggs with setuptools, article about easy_intall developerworks
  2. On packaging
Categories: development

buiding the toolchain from iphone-dev

October 22, 2010 Leave a comment

没有Mac有个iphone,想玩app怎么办?据说是可以在linux或者windows(cygwin)上做开发的,O’Reilly还出了本书iPhone Open Application Development。在有钱买apple前,实在忍不住想在最cool的移动计算平台iPhone上玩玩它的应用开发(好像在《程序员》里对Android创始人的专访中提到,Andy Rubin用的手机是iPhone)。

大概记录一下在ubuntu910下构建toolchain的步骤,主要步骤参考官网wiki的HOWTO build the toolchain。flex (2.5.35)和bison (2.4.1)都是直接从ubuntu的源里安装的。由于默认的gcc是4.4版本,在编译llvm时出现一堆”xxx was not declared in this scope”的问题,参考issue 149直接换gcc-4.1顺利编译通过。然后构建odcctools时出现了” error: possibly undefined macro: AM_PROG_LEX”问题,然后按照issue 98的方法解决。

Categories: development