Unable to install fastText for python on windows.
Asked Answered
D

4

8

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.

Disavow answered 4/8, 2018 at 6:13 Comment(3)
fastText is the official Python binding module by Facebook. fasttext is another module/package currently published on PyPI but it is no longer developed and has known memory issues. I changed the wheels at lfd.uci.edu/~gohlke/pythonlibs/#fasttext to the bindings by Facebook.Leonteen
you mentioned memory errors with fasttext from the old wheels. The new wheels are for fastText.Leonteen
@Leonteen It works now. Please post the answer so that I may accept it.Disavow
D
22

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.

Disavow answered 8/8, 2018 at 14:45 Comment(3)
The link appears to be broken. :(Mirk
Update 05/05/23 : the link and the solution provided worked.Bateau
The link is again broken.Cousteau
O
2

Since the link mentioned above seems to be down for now, here's a zipped version of the wheel for Windows and Python 3.11 that really works!

Link

After downloading run

pip install fasttext-0.9.2-cp311-cp311-win_amd64.whl
Obadias answered 7/6 at 13:50 Comment(1)
After downloading the wheel from the link you provided, I could install FastText on my Windows 11 machine (Python 3.11). Thank youUdine
B
1

I had to create my environment with python=3.8. This allowed me to install fasttext on my pc.

Boron answered 14/9, 2022 at 3:7 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Ob
W
1

Download Microsoft Visual C++ Build Tools and install MSVC v140 - VS2015 C++ Build Tools (v14.00). It’s located in the Individual components tab of Visual Studio Installer.

Then, pip install fasttext.

Waggery answered 11/11, 2022 at 23:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.