How to set up 32 bit python2.7 on 64 bit hosts?

Created by Zhenqiang Chen on on 2014-10-14

* For 64 bit Windows,
  - get 32 bit binary package from
  - install it. Note: Please add it to PATH in the last step.

* For Ubuntu 13.04 or later,

  sudo apt-get install libpython2.7:i386

* A prebuilt Linux python2.7 is shared at

* For older Ubuntu before 13.04, if you want to build and install it by yourself, here are the steps:

  The following steps take Python-2.7.8 as example.

  - sudo apt-get install ia32-libs /* 32 bit system libraries are required. */
  - get python2.7.8 source package from
  - unzip it.
  - cd Python-2.7.8
  - CC="gcc -m32" LDFLAGS="-L/lib32 -L/usr/lib32 -Lpwd/lib32 -Wl,-rpath,/lib32 -Wl,-rpath,/usr/lib32" ./configure --prefix=/opt/python --enable-shared --enable-unicode=ucs4
  - make
  - sudo make install
  - export LD_LIBRARY_PATH=/opt/python/lib