snipsco / snips-nlu

Snips Python library to extract meaning from text
https://snips-nlu.readthedocs.io
Apache License 2.0
3.88k stars 515 forks source link

Installing language resources fail on Windows 10 due to failed symbolic linking #876

Closed swayson closed 4 years ago

swayson commented 4 years ago
λ python -m snips_nlu download en
Requirement already satisfied: snips_nlu_en==0.2.3 from https://github.com/snipsco/snips-nlu-language-resources/releases/download/snips_nlu_en-0.2.3/snips_nlu_en-0.2.3.tar.gz#egg=snips_nlu_en==0.2.3 in c:\users\USERNAME\miniconda3\envs\snips-nlu\lib\site-packages (0.2.3)

The language resources were successfully downloaded, however linking failed.
Creating a shortcut link for 'en' didn't work: OSError('symbolic link privilege not held')

Here are system details

OS Name: Microsoft Windows 10 Pro
OS Version: 10.0.18362 N/A Build 18362
snips-nlu: 0.20.2
conda 4.8.2

Using conda for virtual environment, but did pip install snips-nlu within it.

swayson commented 4 years ago

Tried workaround in: https://github.com/snipsco/snips-nlu/issues/855#issuecomment-558561374

By running following command: pip install -U https://github.com/snipsco/snips-nlu-language-resources/releases/download/snips_nlu_en-0.2.3/snips_nlu_en-0.2.3.tar.gz

Which worked. But then I get errors for other entity resources like city and I don't see those resources on the release list, and the linking fails with that as well if I try and install using the recommend action in the exception.

engine.fit(dataset)
...
~\Miniconda3\envs\snips-nlu\lib\site-packages\snips_nlu\entity_parser\builtin_entity_parser.py in find_gazetteer_entity_data_path(language, entity_name)
    160         "You must download the corresponding resources by running "
    161         "'python -m snips_nlu download-entity {e} {lang}' before you can use "
--> 162         "this builtin entity.".format(e=entity_name, lang=language))
    163 
    164

FileNotFoundError: No data found for the 'snips/city' builtin entity in language 'en'. You must download the corresponding resources by running 'python -m snips_nlu download-entity snips/city en' before you can use this builtin entity.
adrienball commented 4 years ago

Hi @swayson , I'm not familiar with windows, but from what I've read it seems that on windows you need admin privilege to create symbolic links (even though you are working in a virtual environment 🤔?), could you try what is suggested here and report if it worked ? Thanks

swayson commented 4 years ago

@adrienball I tried your suggestion of running it as administrator, and it worked! Surprised it was necessary in conda, but luckily I do have rights. Thank you for your help. 😃

Linking successful
C:\Users\USERNAME\Miniconda3\envs\snips-nlu\lib\site-packages\snips_nlu_en\snips_nlu_en-0.2.3 --> C:\Users\USERNAME\Miniconda3\envs\snips-nlu\lib\site-packages\snips_nlu\data\en