Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. # Building Python 3.5 (32-bit) modules with Anaconda and MINGW64 (without MSVC 2015)
  2.  
  3. To create 32-bit anaconda environment on 64-bit install:
  4.  
  5. ```
  6. set CONDA_FORCE_32BIT=1
  7. conda create -n py35_32 python=3.5
  8. ```
  9.  
  10. To install mingw64, don't use mingw package (deprecated). Intsead:
  11.  
  12. ```
  13. conda install m2w64-toolchain
  14. ```
  15.  
  16. Modify env\py35_32\Lib\distutils\cygwincompiler.py with rule for MSVC 1900:
  17.  
  18. ```
  19. elif msc_ver == '1600':
  20. # VS2010 / MSVC 10.0
  21. return ['msvcr100']
  22. elif msc_ver == '1900':
  23. return ['vcruntime140']
  24. else:
  25. raise ValueError("Unknown MS Compiler version %s " % msc_ver)
  26. ```
  27.  
  28. To compile, need to tell it to use mingw32 compiler and add folder with vcruntime140.dll to library search path.
  29.  
  30. ```
  31. python setup.py build_ext --compiler=mingw32 -LC:\Miniconda3-x64\envs\py35_32 -i
  32. ```
  33.  
  34. Confirm the resulting file is 32 bit (should be obvious from filename!):
  35.  
  36. ```
  37. D:\pycatchmod>file pycatchmod\_catchmod.cp35-win32.pyd
  38. pycatchmod\_catchmod.cp35-win32.pyd: PE32 executable (DLL) (console) Intel 80386 (stripped to external PDB), for MS Windows
  39. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement