I am running pytextrank were in its second stage, I get this error from spaCy:
File "C:\Anaconda3\lib\pathlib.py", line 371, in wrapped return strfunc(str(pathobj), *args)
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Anaconda3\\lib\\site-packages\\spacy\\data\\en\\vocab\\strings.json'
I looked for strings.json but there is no such thing.
The interesting thing is that similar error with pathlib.py existed when I installed spaCy with the following error code:
OSError: Symbolic link privilege not held
Do you guys have any idea ? Thanks
The
Symbolic link privilege not held
error usually occurs when you've installed spaCy and the models into a system directory, but your user does not have the required permissions to create symbolic links. To solve this, either rundownload
orlink
again as administrator or, if that's not possible, use avirtualenv
to install everything into a user directory instead (for more info on this, see the troubleshooting docs).As of v1.7.0, spaCy creates symlinks aka. shortcut links in the
spacy/data
directory. This makes it easier to store your models wherever you want, install them as Python packages and load them using custom names, e.g.spacy.load('my_model')
.What likely happened in your case is that spaCy failed to set up this link because of the permissions error, and now can't find and load the model – including
vocab/strings.json
. (The way spaCy failed here is unideal, though – this has since been fixed in v1.7.3.)Since the model is already installed, all you'd have to do is create a new symlink for it (either as admin, or in a
virtualenv
):(If you've downloaded a different model, simply replace
en_core_web_sm
with the name of that model.en
is the shortcut to use and can be any name you want.)Edit: In case you only want to use the tokenizer and don't care about the models, or want to use one of the supported languages that don't yet come with a statistical model, you can also just import the
Language
class in v1.7.3: