1

I want to use SpacyTextBlob in google Colab, when I use the formal installation, I got the below error.

OSError: [E053] Could not read config.cfg from /usr/local/lib/python3.7/dist-packages/en_core_web_sm/en_core_web_sm-2.2.5/config.cfg

what I do, first run this block:

import spacy
!pip install spacytextblob

then based on the output I restart the runtime. then run this code:

from spacytextblob.spacytextblob import SpacyTextBlob
nlp = spacy.load('en_core_web_sm')
nlp.add_pipe("spacytextblob")

but at the first line, I got the error.

if I don't install SpacyTextBlob the default version of Spacy on Colab it's 2.2.4 but after installation the Spacy version it's 3.2.1

there is an answer here for the same error but I can't use it.

I guess the problem it's from the spacy version which changed after installing the Spacytextblob but how can I fix it?

zana saedpanah
  • 324
  • 3
  • 12
  • Can you provide replicable errors? when I try the first 3 lines in Colab, i get ```AttributeError: type object 'Language' has no attribute 'factory' ``` – rikyeah Jan 15 '22 at 10:50
  • you need to restart the runtime to work. I change the order of the code in question. thank you @rikyeah – zana saedpanah Jan 15 '22 at 10:55

1 Answers1

2

I solve the problem by using this installation guide

!pip install spacytextblob
!python -m textblob.download_corpora
!python -m spacy download en_core_web_sm
zana saedpanah
  • 324
  • 3
  • 12