loretoparisi / fasttext.js

FastText for Node.js
MIT License
192 stars 28 forks source link

Executable not found in path on Windows #22

Closed MarcDelp closed 3 years ago

MarcDelp commented 4 years ago

Hi !

Node version: 12.13.1 OS: Windows 10

I'm trying to create a simple fastText model for text classification, but the lib is not working fine on Windows. As soon as I add this code:

const fastText = new FastText({
      serializeTo: './models/fastText',
      trainFile: './trainingData.txt'
});

I have the error:

Error: executable not found in path
    at new FastText (C:\Users\madelpech\[...]\node_modules\fasttext.js\lib\index.js:104:23)

I have looked to the code and in the index.js file line 99 you are calling this._options.bin = Util.GetBinFolder('fasttext');. I have checked the binaries and it appears that the Windows binary is not named fasttext but fastText.exe instead. This should be the issue here.

Can you have a look and tell me if I am right?

Thanks!

loretoparisi commented 4 years ago

@MarcDelp yes code it is ok, but for MS windows the support is out dated. The win32 executable is provided in /lib/bin/win32 folder and yes just try to change the name to fastText.exe as executable file path. Windows support for 32 bit applications in 64bit OS it's ok, so it should work.

MarcDelp commented 4 years ago

Okay @loretoparisi Thanks for the quick response :)

feernando998 commented 3 years ago

Hi !

Node version: 12.13.1 OS: Windows 10

I'm trying to create a simple fastText model for text classification, but the lib is not working fine on Windows. As soon as I add this code:

const fastText = new FastText({
      serializeTo: './models/fastText',
      trainFile: './trainingData.txt'
});

I have the error:

Error: executable not found in path
    at new FastText (C:\Users\madelpech\[...]\node_modules\fasttext.js\lib\index.js:104:23)

I have looked to the code and in the index.js file line 99 you are calling . I have checked the binaries and it appears that the Windows binary is not named but instead. This should be the issue here.this._options.bin = Util.GetBinFolder('fasttext');``fasttext``fastText.exe

Can you have a look and tell me if I am right?

Thanks!

Hello MarcDelp,, were you successful in using fasttext with Js on windows? Thanks.

MarcDelp commented 3 years ago

Hey @feernando998

Honestly, I can't remember what was my final thought on this... I think that I ended changing the exe name for my local installation since the deployed image was based on Linux and didn't need correction. This enabled me to develop on my local and then I could check on the image built that everything was fine.

feernando998 commented 3 years ago

Hey @feernando998

Honestly, I can't remember what was my final thought on this... I think that I ended changing the exe name for my local installation since the deployed image was based on Linux and didn't need correction. This enabled me to develop on my local and then I could check on the image built that everything was fine.

Got it, thanks for answering me!

loretoparisi commented 3 years ago

@feernando998 @MarcDelp thank you guys, feel free to submit a PR to fix this issue, currently I do not have a Windows machine to test it, but if you can submit a PR, so that it will go in in the repo.

Thanks a lot.

searleser97 commented 3 years ago

I am still seeing this issue, Why is it closed?