duckling
duckling copied to clipboard
Running Duckling on Windows
Hello guys,
I'm having a hard time getting Duckling to run properly on Windows and I hope you can point me in the right direction.
Starting from the master branch, I've done some minor modifications, based on answers I encountered in other issues about windows 10 in this repo:
- Replace
regex-pcre
withregex-pcre-builtin
(setting up pcre on windows isn't an easy task) - Changed the path of the timezone folder in
ExampleMain.hs
from/usr/share/zoneinfo
tozoneinfo/
(and copied the folder with olson TZ to my windows machine) - Changed the import of
System.FilePath
inTimeZone.hs
forSystem.FilePath.Posix
(otherwise, it returns timezones likeAmerica\\Los_Angeles
)
These changes were tried on a friend's OSX laptop and the app still ran just fine, so I guess it's something windows-related.
Everything compiles perfectly. Using curl to call the service returns effectively quack!
. However, any call to /parse will yield an Empty reply from server
.
While debugging manually, the issue arose when the line parsedResult = parse...
is called in ExampleMain.hs
.
Following the instructions in the readme, I ran the example query with Duckling.Debug
*Duckling.Debug> debug (makeLocale EN $ Just US) "in two minutes" [This Time]
*** Exception: user error (Text.Regex.PCRE.String died: (2,"invalid UTF-8 string"))
I've tried setting LANG=C.UTF-8 when building, and when running it, to no avail. Is there anything else I could check out ?
Thanks!
(On a side note, would it be feasible to save the output of loadTimeZoneSeries
in a single file, which could be optional for users without Olson files? Copying 1700 files of 1k is a bit overkill, since the output of that call is simply a hash map of 13kb)
I finally got it working! The issue was the code page setting of cmd.exe.
For future windows users, simply type CHCP 65001
in the console, then start Duckling.
Everything is working fine, even timezones!
If someone is willing to help and tell me how to save the result of loadTimeZoneSeries to a file, and load it instead of parsing the Olson folders, I would really appreciate that! I lack the Haskell skills to do that.
Thank you
Hey @allardy I followed all the steps one by one but i got this error : duckling-example-exe.EXE: zoneinfo/: getDirectoryContents:findFirstFile: does not exist (Le chemin d’accès spécifié est introuvable.) Ps : I am a windows user . Any suggestion please ?
@Dejlaaa The missing step is to copy the content of the zoneinfo folder (the olson files) from a linux machine. The folder zoneinfo should be in the same folder as the executable
I've made the changes and included the zipped zoneinfo files on a forked repo, if you want them: https://github.com/botpress/duckling/pull/1/files
It works using the docker image thanks :)
@allardy how can I integrate the duckling in my bot ??
So chcp 65001 will work when using stack runghc but does not work when you use stack install and then start an exe file (in this case duckling-example-exe.exe). Is there anyother way ?
Hi, I am encountering this error while trying to stack build. Kindly help
Hi, I am encountering this error while trying to stack build. Kindly help
I have downloaded and added timezone folder to exe folder
I am adding below the detailed steps which i followed on windows 10 for Duckling, so that it is helpful for anyone who faces this problem in the future:
- https://github.com/facebook/duckling download and store code in a folder from here
- https://github.com/botpress/duckling/pull/1/files -> do changes in files mentioned in this link
- https://github.com/facebook/duckling/issues/412 -> do steps mentioned in this else "stack exec duckling-example-exe" will give error
- in command window go to the folder where downloaded this code
- run CHCP 65001 in command prompt
- follow the steps in the readme of https://github.com/facebook/duckling
@ishaneuralsift or someone else, do you want to add some instructions to the README?
I finally got it working! The issue was the code page setting of cmd.exe. For future windows users, simply type
CHCP 65001
in the console, then start Duckling.Everything is working fine, even timezones!
If someone is willing to help and tell me how to save the result of loadTimeZoneSeries to a file, and load it instead of parsing the Olson folders, I would really appreciate that! I lack the Haskell skills to do that.
Thank you
thanks man! couldnt sleep last night bcos of the issue you saved my day !!