[wxPython-users] Re: wxPython install

Robin Dunn robin at alldunn.com
Mon Mar 10 12:49:23 PDT 2008


Gordon Robertson wrote:
> Robin Dunn <robin <at> alldunn.com> writes:
> 
>> You might just try to ensuring that the dir where cl.exe and link.exe 
>> are located is on the PATH.  I know that at least in the past distutils 
>> would still work if all it could do is use the environment.  You may 
>> also have to set INCLUDE and LIB in the environment to allow the 
>> standard include and lib paths to be used too.
> 
> Robin...I changed the path/registry to reflect what you suggested below, 
> that the pathname should have no spaces in it. Under 
> HKLM\Software\Microsoft\VisualStudio\Setup\VS I added a string value named 
> productdir and pointed it to the new directory I created with no spaces in 
> the name. I added the bin subdir from the Visual Studio 9 dir, containing 
> the command line compiler, to the new directory.
> 
> I was not expecting this hack to work so much as I was looking to see if the 
> directory had been recognized. It was either recognized and rejected, or it 
> was not recognized.
> 
> When I ran:
>  python_d setup.py build_ext --inplace MONOLITHIC=0 --debug
> in the %WXDIR%\wxPython directory, it fell through to this 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.""")
> ***
> 
> It's not clear to me what the message means. Is it implying that cl.exe and 
> link.exe in the Visual Studio 9.0 bin directory is not backward compatible; 
> that it can't compile wxPython because it was built with VS 2003?
> 
> Also, why is it looking specifically for VS 2003?

You may need to ask about this in some other place (distutils-sig for 
example) because it is starting to get beyond what I know.  Python 
requires that the extension modules be compiled with  a compiler that 
has a runtime that is compatible with what was used to compile python 
itself.  For MS compilers this usually means that it must be the same 
version.  Looking at the code in msvccompiler.py it looks like it is 
trying to find the info it needs for the same version by using the 
compiler version recorded in the sys.version string, and is raising that 
exception if it can't find it.  The VS 2003 is hard coded in the error 
message and it appears it will say that no matter which version of the 
compiler it is actually looking for and can't find.



-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-users mailing list