본문 바로가기

Error and Solve

[에러 해결] OSError: Can't find model 'en_core_web_lg'. spacy error / spacy.cli로 download

반응형

 

 

1. OSError: Can't find model 'en_core_web_lg'. spacy error 

 

 scapy 패키지 관련 에러가 났다 

 

오류 내용은 'en_core_web_lg'를 찾을 수 없다는 내용  

 

 

 

 

2. cli.download

 

 

import spacy.cli
spacy.cli.download("en_core_web_lg")
nlp = spacy.load("en_core_web_lg")

 

import spacy.cli 

spacy.cli.download("en_core_web_lg") 

 

먼저 이 코드를 실행해서 해당 모델을 다운로드 받는다 

 

 

download를 실행하면 en-core-web-lg가 다운로드 되었으며 

다시 시작하라는 말이 나온다 

 

 

 

 

 

 

 

터미널을 exit한 후 

 

nlp = spacy.load("en_core_web_lg")

 

코드를 실행하면 

 

파이썬 터미널에서 저렇게 잘 실행되면 

코드에서도 돌려도 된다 

 

 

 

 



3. 여담

 

만약 import spacy 또는 import spacy.cli 

코드를 실행할 때부터 에러가 난다면 

 

python version이 3.12 이상이 아닌지 확인해보고 downgrade하는 것이 좋다 

 

 

 

 

 

 


 

Reference

https://stackoverflow.com/questions/49964028/spacy-oserror-cant-find-model-en

 

SpaCy OSError: Can't find model 'en'

even though I downloaded the model it cannot load it [jalal@goku entity-sentiment-analysis]$ which python /scratch/sjn/anaconda/bin/python [jalal@goku entity-sentiment-analysis]$ sudo python -m sp...

stackoverflow.com

 

https://stackoverflow.com/questions/78593700/langchain-community-langchain-packages-giving-error-missing-1-required-keywor

 

langchain_community & langchain packages giving error: Missing 1 required keyword-only argument: 'recursive_guard'

All of sudden langchain_community & langchain packages started throwing error: TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard' The error getting

stackoverflow.com

 

 

https://github.com/explosion/spaCy/issues/12659

 

FIXED: Pydantic issubclass error for python 3.8 and 3.9 · Issue #12659 · explosion/spaCy

UPDATE: This is now fixed for spacy v3.4 and v3.5 with the release of Pydantic v1.10.8. New installs with pip install spacy should work without issue. To fix an existing venv for spacy v3.4 or v3.5...

github.com

 

 

https://stackoverflow.com/questions/56927602/unable-to-load-the-spacy-model-en-core-web-lg-on-google-colab

 

Unable to load the spacy model 'en_core_web_lg' on Google colab

I am using spacy in google colab to build an NER model for which I have downloaded the spaCy 'en_core_web_lg' model using import spacy.cli spacy.cli.download("en_core_web_lg") and I get a

stackoverflow.com

 

반응형