I was trying to compile some C++ source that uses scons as its build system. On my 64 bit windows machine with python 3.2.X (64 bit) and what I thought was python 2.7.X (32 bit) I would get the following error when trying to run scons:
scons: *** no platform named ‘win32’
I was fairly certain that my 2.7 installation was 32 bit, because in the past I’d tried using scons with a 64 bit system and it had outright refused to function. I spent an hour or so playing with it, tried repairing the install, poking around on google/SO, etc. but couldn’t find a solution. Finally I uninstalled python 2.7 using both a 32 and a 64 bit installer (I guess I must’ve had both installed in the same location?), uninstalled scons, deleted the remaining python27 folder and reinstalled 32 bit python and scons.
Now scons works!
Since I hadn’t found a solution on SO, I thought I should post mine, but I’d also like to know what causes this error?
What causes the scons error “no platform named ‘win32′”?
I have actually had this problem myself. This is caused by the scons.bat using the wrong python library. Somehow the installation gets screwed up and when you run things in 2.7 it tries using the libraries from python 3. I solved this quite simply by editing the scons.bat script, and setting python path and python home in the script.
The changes are shown here.
After this it works fine as long as I specify this scons.bat script for running scons.