python-3.xfasttext

Unable to install fastText for python on windows.


So I am unable to install fasttext for python on windows. I followed the methods mentioned in this issue

When I enter python setup.py install, I get the following error:

error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\cl.exe' failed with exit status 2

I tried using the wheel at https://www.lfd.uci.edu/~gohlke/pythonlibs/#fasttext. It does install a module, however the name of the module is fasttext unlike fastText that gets installed on Ubuntu following the method mentioned in Readme.md. Also the fasttext module that does get installed is unable to load a prebuilt model like wiki.de.bin. I get an error saying Cannot load ../fasttext/wiki.es/wiki.es.bin due to C++ extension failed to allocate the memory Relevant issue.

I have created an issue here, and am asking the same question here, hoping to get a faster response from this community.


Solution

  • With the help of @cgohlke comment above, I was able to install it for windows. Just go to https://www.lfd.uci.edu/~gohlke/pythonlibs/#fasttext. Download the wheel depending on your version. pip install .whl file. It works now.