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 run download
or link
again as administrator or, if that's not possible, use a virtualenv
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
):
python -m spacy link en_core_web_sm en
(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:
from spacy.fr import French
nlp = French()
pytextrank
for installing directly through Anaconda -- currently it has PyPi support. – Boarhound