To create 32-bit anaconda environment on 64-bit install:
set CONDA_FORCE_32BIT=1
conda create -n py35_32 python=3.5
To install mingw64, don't use mingw package (deprecated). Intsead:
conda install m2w64-toolchain
Modify env\py35_32\Lib\distutils\cygwincompiler.py with rule for MSVC 1900:
elif msc_ver == '1600':
# VS2010 / MSVC 10.0
return ['msvcr100']
elif msc_ver == '1900':
return ['vcruntime140']
else:
raise ValueError("Unknown MS Compiler version %s " % msc_ver)
To compile, need to tell it to use mingw32 compiler and add folder with vcruntime140.dll to library search path.
python setup.py build_ext --compiler=mingw32 -LC:\Miniconda3-x64\envs\py35_32 -i
Confirm the resulting file is 32 bit (should be obvious from filename!):
D:\pycatchmod>file pycatchmod\_catchmod.cp35-win32.pyd
pycatchmod\_catchmod.cp35-win32.pyd: PE32 executable (DLL) (console) Intel 80386 (stripped to external PDB), for MS Windows