Kritik Munot
Kritik Munot

Reputation: 1

Error: raise IOError and OSError while compiling the program in vs code

OSError: [E050] Can't find model 'en_core_web_sm'. It doesn't seem to be a Python package or a valid path to data directory. this is the error i am getting MY code:

from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer
import spacy
nlp = spacy.load("en_core_web_sm")


chatbot = ChatBot("Ron Obvious")
conversation = [
    "Hello",
    "Hi there!",
    "How are you doing?",
    "I'm doing great.",
    "That is good to hear"
    "Thank you.",
    "You're welcome."
]

trainer = ListTrainer(chatbot)
trainer.train(conversation)

I tried to install python -m download spacy er_core_web_sm and it was successful I am using python 3.8 because this module only support this version or below

Upvotes: -1

Views: 48

Answers (1)

Talha Tayyab
Talha Tayyab

Reputation: 27760

You need to install spacy for python 3.8

try:

pip install -U spacy
python -m spacy download en

then:

import spacy
nlp = spacy.load("en_core_web_sm")

Upvotes: 0

Related Questions