RSS | Comments RSS | Atom


jhcore.com

A source for news, reviews, guides, and tools for technology by John Paulett.

February 2008


Guides03 Feb 2008 05:28 pm

I always forget how to build Python packages, such as psyco and simplejson that require C/C++ code to be compiled. The usual error I get from running “python setup.py install” is:

error: Python was built with Visual Studio 2003;
extensions must be built with a compiler than can generate compatible binaries. Visual Studio 2003 was not found on this system. If you have Cygwin installed, you can try compiling with MingW32, by passing “-c mingw32″ to setup.py.

Now, I do not have Visual Studio 2003, but I do have mingw32. (Grab cygwin and when selecting packages, make sure than mingw-runtime and gcc are selected.)

Now, back with our setup.py file, execute:

python setup.py build_ext --compiler=mingw32 install

Hopefully that should solve any issues.

Guides02 Feb 2008 02:56 pm

To use Perl’s CPAN on Windows with cygwin, you need to install some additional programs in cygwin. Run cygwin’s setup.exe (I like clicking the “View” button to change the listing to Full, so I get an alphabetical list of the packages).

Make sure that you install the following packages:

  • perl (just in case you do not have it)
  • gzip
  • tar
  • unzip
  • make
  • lynx
  • wget
  • ncftp
  • gnupg

Open the Cygwin bash shell and enter:

perl -MCPAN -e shell

Accept the defaults, and you are good to go.

Once in the CPAN shell, you can install modules with commands like:

install Date::Parse