Using Buildout system on Windows
Okay, so you’ve heard something about buildout system, and started to use it. Once upon a time, your project is required to be deployed on Windows host. Let the show begin…
Buildout is extremely powerful, yet very simple to use tool to do automatic deployments. Imagine, that you need to deploy your app on some random unknown generic Linux host, where there is nothing but gcc and a few system tools (python included) — what a pain in the ass this could possibly be? Having to deal with manual installation of different packages (versions nightmare included) is such a pain. I don’t even want to consider what to do if you don’t have a root access rights on target machine.
Buildout is built by the Zope/Plone team to tackle all above mentioned problems. The only problem, though, is that it works smoothly only on *nix environments, which is not our case.
So, if there is absolutely no way around for you but deployment on Windows, read more.
Step 1. Prepare your windows environment
Scenario described below was tested on virtualboxed WindowsXP machine.
- Go to python.org and download Python 2.7.1, Run & install python into C:\Python27
- Go to Python Package Index (PyPI) and download setuptools-0.6c11.win32-py2.7.exe. Run & install. (If you have 64-bit windows system, go here http://www.lfd.uci.edu/~gohlke/pythonlibs/ and download setuptools-0.6c12dev.win-amd64-py2.7.exe)
- Go to PyWin32 page and download appropriate version for Python 2.7, run & install.
- Go to MinGW home page, download Windows installer, run mingw-get-inst.exe. Make sure to check “C++ compiler” during installation dialogs. By default, MinGW should be installed to C:\MinGW
- Install Unix utils for win32. Go to UnxUtils page, unzip all *.exe files to C:\Windows\system32, it is safe to overwrite some of existing system executables (Windows will complain about this, so you have to click OK in couple of dialogs)
Step 2. Set system %PATH% variable
It should include
- C:\Python27\
- C:\Python27\Scripts\
- C:\MinGW\bin\
Once, this is done gcc, python, easy_install commands should be available in your command line:
gcc:
C:\nimble\nimble-tests>gcc --v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.5.2/lto-wrapper.exe Target: mingw32 Configured with: ../gcc-4.5.2/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --disable-werror --build=mingw32 --prefix=/mingw Thread model: win32 gcc version 4.5.2 (GCC)
easy_install:
C:\nimble\nimble-tests>easy_install --version distribute 0.6.11
python:
C:\nimble\nimble-tests>python Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>>
chmod:
Page 1 of 2 | Next page