OSError: [E053] Could not read config file from C:\Users\ - spacy

I am trying to run nlp = en_core_web_sm.load(). But getting below error continuously
OSError: [E053] Could not read config file from C:\Users\xxxxx\Anaconda3\lib\site-packages\en_core_web_sm\en_core_web_sm-2.3.1\config.cfg
I have checked solution for similar issue (https://github.com/OmkarPathak/pyresparser/issues/46) and followed below steps:
pip install nltk
pip install spacy==2.3.5
pip install https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.3.1/en_core_web_sm-2.3.1.tar.gz
pip install pyresparser
Still I am getting same error.
I am using spaCy version 2.3.5 and en_core_web_sm version 2.3.1
Can someone please help?

Normally the way you would install the spaCy model and use it is like this.
First in the shell:
pip install spacy==2.3.5
python -m spacy download en_core_web_sm
Then in Python:
import spacy
nlp = spacy.load("en_core_web_sm")
I am not exactly sure what is causing your particular error - maybe because you are using pip install with a URL directly something is getting set up oddly? It is also possible you are getting weird interactions between conda and pip.

For Spacy 2.3.5 version and to have it worked efficiently it is better to follow these steps:
Use Python 3.6 to 3.9 version. Check version of python installed
python -V
Use Upgraded pip
python -m pip install –-upgrade pip
Install wheel
pip install -U wheel
Install spacy
pip install -U spacy==2.3.5
Download en_core_web_sm
python -m spacy download en_core_web_sm
Then in python
import spacy
nlp = spacy.load("en_core_web_sm")

you can write !python -m spacy download en_core_web_sm
before loading model like
`import spacy
from spacy import displacy
!python -m spacy download en_core_web_sm
NER = spacy.load("en_core_web_sm", disable=["tok2vec", "tagger", "parser", "attribute_ruler", "lemmatizer"])
`
it work for me in jupyter with python3

Related

python -m spacy download en_core_web_sm fails using spacy 3.0.3

Why am I getting this error AttributeError: module 'srsly' has no attribute 'read_yaml'
when I attempt python -m spacy download en_core_web_sm
I've been following the instructions here Install spaCy
I was using an earlier version of srsly which gave me this issue. Fixed it by upgrading it to latest version
pip install -U srsly
I had the same problem recently. Solved it by doing
pip uninstall spacy
pip install spacy 2.3.2
Its maybe a bug due to the latests versions of spacy

ModuleNotFoundError: No module named 'bert' even after pip install bert-tensorflow and pip install bert-for-tf2

I have tensorflow 1.9.0 and after successful installation of bert using !pip install bert-tensorflow, I cannot import bert in Jupyter notebook. I even ran !pip install bert-for-tf2. Still no success.
It turns out I did not have tensorflow in my environment. Fixed after installing tensorflow.

Python cannot find Tensorflow module

With Python3.5, I try to use the 'tensorflow' module:
import tensorflow as tf
But.. it says No mudule named tensorflow
I just tried to download the module with pip3:
pip3 install --upgrade tensorflow-gpu
(I have all the requirements to run tensorflow with GPU support as described at tensorflow.org)
I've seen a similar question here ImportError: No module named tensorflow , here's a sum up of what's inside:
Make sure installation is correct via:
pip3 show tensorflow
You can optionally re-install it again using: pip install tensorflow==1.2.0 --ignore-installed
Make sure you're running the python code with Python 3.x, verify using: python --version
Make sure you install TF and run the script through the same user, avoid installing TF using sudo pip install... and running the code with python script.py

pip install tensorflow fails - MAC OSError: [Errno 13]

I am trying to install tensorflow on mac Sierra. When I run pip install tensorflow I get following report.
It works fine for me by using command :
pip3 install https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.10.1-py3-none-any.whlrflow-1.10.1-py3-none-any.whl
run sudo pip install tensorflow
The problem appears to be, that you have not got the rights to install tensorflow globally. Therefore, one solution appears to be, that you try to install tensorflow locally using the following command:
pip install tensorflow --user

Cant import keras

I ran the following on my Anaconda command prompt for python 3.6:
pip install keras
Next, typing the following on Spyder:
import keras
The above gives me an error:
No module named 'tensorflow'
Tring to do pip install tensorflow on the Anaconda command prompt gives me the follwing error:
No matching distribution found for tensorflow
To install a module into anaconda, use
$ conda install tensorflow
The command that you ran
$ pip install tensorflow
will not install it inside the anaconda virtualenv for python.
If you try
$ python
>>> import keras
This will work after pip install tensorflow. However, use conda package manager to install modules to anaconda.