I have the "Enthought Canopy" v1.5 distribution of Python 2.7 installed with cython 0.22 (installed via the Canopy package manager) on a Windows 64-bit computer. Trying to compile a cython file leads to the following error:
building 'my_cython_extension' extension
error: Could not find Visual Studio 2008 in your path.
If you do not have Visual Studio 2008 installed, you can use
the MinGW compiler instead. To install mingw, do:
enpkg mingw
To use the MinGW compiler to build an extension module, use
the '-c' flag, e.g.:
python setup.py build_ext -c mingw64
Note that building Python extensions with MinGW is not officially
supported, although it is known to work in many cases.
Visual Studio 2008 is no longer available, and Visual Studio 2008 Express doesn't include a 64-bit compiler. I've read that it's necessary to compile cython with the same compiler that Python was compiled with, which rules out using a newer version of Visual Studio. Additionally, the message clearly states that MinGW is not officially supported.
I've tried installing "Microsoft Visual C++ Compiler for Python 2.7" as per the Cython Wiki, but that has no effect on making the above error message disappear. I've read that updating setuptools
may fix this error (as it can find the compiler in different locations than the old version expects to find it), but that didn't work for me, and additionally Enthought have stated on their website that:
Setuptools 0.6 is already supported, and higher versions are not yet compatible with Enthought installers.
... so updating setuptools may break something in Canopy.
Finally, I've tried installing "MS Windows SDK for Windows 7 and .NET Framework 3.5 SP1" as written later on in the cython Wiki, but this also had no effect on making the message disappear, and additionally it's a huge unwieldy package which I'd rather not install just for the compiler if possible.
So, is there a way to get "Microsoft Visual C++ Compiler for Python 2.7" working with cython and Enthought Canopy? If not, what is the official way to install and configure the cython compiler?