what is difference between spacy.load(\'en_core_web_sm\')
and spacy.load(\'en\')
? This link explains different model sizes. But i am still not clea
For those who are still facing problems even after installing it as administrator from Anaconda prompt, here's a quick fix:
1) Got to the path where it is downloaded. For e.g.
C:\Users\name\AppData\Local\Continuum\anaconda3\Lib\site-packages\en_core_web_sm\en_core_web_sm-2.2.0
2) Copy the path.
3) Paste it in: nlp = spacy.load(r'C:\Users\name\AppData\Local\Continuum\anaconda3\Lib\site-packages\en_core_web_sm\en_core_web_sm-2.2.0')
4) Works like a charm :)
PS: Check for spacy version
Loading the module using the different syntax worked for me.
import en_core_web_sm
nlp = en_core_web_sm.load()
Anaconda Users
If you're using a conda virtual environment, be sure that its the same version of Python as that in your base environment. To verify this, run python --version
in each environment. If not the same, create a new virtual environment with that version of Python (Ex. conda create --name myenv python=x.x.x
).
Activate the virtual environment (conda activate myenv
)
conda install -c conda-forge spacy
python -m spacy download en_core_web_sm
I just ran into this issue, and the above worked for me. This addresses the issue of the download occurring in an area that is not accessible to your current virtual environment.
You should then be able to run the following:
import spacy
nlp = spacy.load("en_core_web_sm")