title: How to install python-levenshtein on Windows?
body: <p>After searching for days I'm about ready to give up finding precompiled binaries for Python 2.7 (Windows 64-bit) of the <a href="http://pypi.python.org/pypi/python-Levenshtein/" rel="noreferrer">Python Levenshtein library</a>, so not I'm attempting to compile it myself. I've installed the most recent version of <em>MinGW32</em> (version 0.5-beta-20120426-1) and set it as the default compiler in <em>distutils</em>.</p>
  
  <p>Here we go:</p>
  
  <pre>
  C:\Users\tomas>pip install python-levenshtein
  Downloading/unpacking python-levenshtein
    Running setup.py egg_info for package python-levenshtein
  
      warning: no files found matching '*' under directory 'docs'
      warning: no previously-included files matching '*pyc' found anywhere in distribution
      warning: no previously-included files matching '.project' found anywhere in distribution
      warning: no previously-included files matching '.pydevproject' found anywhere in distribution
  Requirement already satisfied (use --upgrade to upgrade): setuptools in c:\python27\lib\site-packages\setuptools-0.6c11-py2.7.egg (from python-levenshtein)
  Installing collected packages: python-levenshtein
    Running setup.py install for python-levenshtein
      building 'Levenshtein' extension
      C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python27\include -IC:\Python27\PC -c Levenshtein.c -o build\temp.win-amd64-2.7\Release\levenshtein.o
      cc1.exe: error: unrecognized command line option '-mno-cygwin'
      error: command 'gcc' failed with exit status 1
      Complete output from command C:\Python27\python.exe -c "import setuptools;__file__='c:\\users\\tomas\\appdata\\local\\temp\\pip-build\\python-levenshtein\\setup.py';exec(compile(open(__file__).rea
  d().replace('\r\n', '\n'), __file__, 'exec'))" install --record c:\users\tomas\appdata\local\temp\pip-7txyhp-record\install-record.txt --single-version-externally-managed:
      running install
  
  running build
  
  running build_ext
  
  building 'Levenshtein' extension
  
  C:\MinGW\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python27\include -IC:\Python27\PC -c Levenshtein.c -o build\temp.win-amd64-2.7\Release\levenshtein.o
  
  cc1.exe: error: unrecognized command line option '-mno-cygwin'
  
  error: command 'gcc' failed with exit status 1
  </pre>
  
  <p>And now I'm stuck. I'm assuming that the <code>-mno-cygwin</code> option is outdated and no longer valid for the version of <code>gcc</code> that I have. If that is the case, I still have no clue how to fix that.</p>
  
  <p>Thanks for any help anybody can offer on this issue.</p>
  
  <hr>
  
  <p>EDIT:</p>
  
  <p>I ran the compile line manually after removing the bad option:</p>
  
  <pre>C:\MinGW\bin\gcc.exe -mdll -O -Wall -IC:\Python27\include -IC:\Python27\PC -c Levenshtein.c -o build\temp.win-amd64-2.7\Release\levenshtein.o</pre>
  
  <p>Which successfully provided <em>levenshtein.o</em> in the build folder, but when I try to run <code>python setup.py install</code> then it just tries to build again and fails. Where can I remove <code>-mno-cygwin</code>? I assume it's somewhere in the source of <em>distutils</em> but I can't find it.</p>