Skip to content

Installation on Windows

Carl edited this page May 14, 2019 · 8 revisions

This was tested for a 64-bit Python installation on Windows Server 2012 but it should be similar for other modern Windows versions.

THE FOLLOWING IS ONLY COMPATIBLE WITH PYTHON VERSION 3.6 AND EARLIER

Install mingw-w64

  1. Download mingw-w64. I used this pre-built version.
  2. Unzip mingw-w64 to a directory with no spaces e.g. C:\mingw64\
  3. Add the bin\ directory to your PATH
  4. Verify that running where gcc.exe in a command prompt prints your MinGW64 installation first. Re-arrange your PATH if not

Compile with MinGW

  1. Install an up-to-date version of libpython (conda install "libpython>=2.1")
  2. Clone this repository and move into its root directory (glove-python)
  3. Run python setup.py build_ext --compiler=mingw32 to verify it builds and double check it uses your installation of MinGW64. You can ignore the warnings but make sure it creates a directory called build\lib.blah with some .pyd files inside

Install

Run pip install . to add the compiled libraries to your current environment

Verify

Running pytest should give the following output:

============================= test session starts =============================
platform win32 -- Python 3.6.5, pytest-3.6.0, py-1.5.3, pluggy-0.6.0
rootdir: E:\Carl\glove-python, inifile:
collected 8 items

tests\test_corpus.py ......                                              [ 75%]
tests\test_glove.py ..                                                   [100%]

========================== 8 passed in 5.36 seconds ===========================