spacy Can't find model 'en_core_web_sm' on windows 10 and Python 3.5.3 :: Anaconda custom (64-bit)

前端 未结 15 1017
傲寒
傲寒 2020-12-08 09:40

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

相关标签:
15条回答
  • 2020-12-08 10:10

    I had also same issue as I couldnt load module using '''spacy.load()''' You can follow below steps to solve this on windows:

    1. download using !python -m spacy download en_core_web_sm
    2. import en_core_web_sm as import en_core_web_sm
    3. load using en_core_web_sm.load() to some variable

    Complete code will be:

    python -m spacy download en_core_web_sm
    
    import en_core_web_sm
    
    nlp = en_core_web_sm.load()
    
    0 讨论(0)
  • 2020-12-08 10:11

    As for Windows based Anaconda,

    1- Open Anaconda Prompt

    2- Activate your environment. Ex: active myspacyenv

    3- pip install https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.2.0/en_core_web_sm-2.2.0.tar.gz

    4- python -m spacy download en_core_web_sm

    5-Open Jupyter Notebook ex: active myspacyenv and then jupyter notebook on Anaconda Promt

    import spacy spacy.load('en_core_web_sm')

    and it will run peacefully!

    0 讨论(0)
  • 2020-12-08 10:12

    The below worked for me :

    import en_core_web_sm
    
    nlp = en_core_web_sm.load()
    
    0 讨论(0)
  • 2020-12-08 10:13

    Open command prompt or terminal and execute the below code:

    pip3 install https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.2.0/en_core_web_sm-2.2.0.tar.gz
    

    Execute the below chunk in your Jupiter notebook.

    import spacy

    nlp = spacy.load('en_core_web_sm')

    Hope the above code works for all:)

    0 讨论(0)
  • 2020-12-08 10:14

    Initially I downloaded two en packages using following statements in anaconda prompt.

    python -m spacy download en_core_web_lg
    python -m spacy download en_core_web_sm
    

    But, I kept on getting linkage error and finally running below command helped me to establish link and solved error.

    python -m spacy download en
    
    0 讨论(0)
  • 2020-12-08 10:16
    import spacy
    
    nlp = spacy.load('/opt/anaconda3/envs/NLPENV/lib/python3.7/site-packages/en_core_web_sm/en_core_web_sm-2.3.1')
    

    Try giving the absolute path of the package with the version as shown in the image.

    It works perfectly fine.

    0 讨论(0)
提交回复
热议问题