python -m spacy download en_core_web_sm fails using spacy 3.0.3 - spacy

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

Related

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

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

tensorflow-data-validation cannot be pip installed

Since I'm moving away from pandas DataFrames to TensorFlow datasets, I'd like to use tensorflow-data-validation instead of the more traditional pandas-profiling when it comes to data exploration and validation.
However, pip install tensorflow-data-validation gives the following error:
ERROR: Could not find a version that satisfies the requirement tensorflow-data-validation (from versions: none)
ERROR: No matching distribution found for tensorflow-data-validation
What could be the problem? This old GitHub issue explains how this could be due to the Python version, but Apache Beam (on which tensorflow-data-validation presumably relies) is now fully compatible with Python 3, so it must be something else.
My environment is as follows:
Python 3.9.2
TensorFlow 2.6.0
Debian GNU/Linux 11 (bullseye)
pip 21.3
I got the same error when using Python 3.9. After downgrading to Python 3.8, pip install tensorflow-data-validation ran successfully.
Regarding your comment about Apache Beam, it looks like the Python SDK currently supports Python 3.8 (and earlier) but not yet Python 3.9.
My environment:
Python 3.8.10
TensorFlow 2.8.0
macOS Monterey (12.0.1)
pip 21.1.1
Try this
pip install --upgrade --force-reinstall tensorflow-data-validation[all]
It might be a version compatibility issue with tensorflow==2.6.0.
Try
pip install tensorflow-data-validation==1.3.0
I was able to install the tensorflow_data_validation library successfully, via the below command in my Google Colab file.
!pip install -U tensorflow \
tensorflow-data-validation \
apache-beam[gcp]

Unable to install tensor flow with pip?

I just updated the latest MacOS and it wiped everything out.
I follow the steps from this website.
And I start reinstalling the tensorflow with pip3 and it's not installing anything.
I got this error from typing pip3 install --user --upgrade tensorflow .
ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
ERROR: No matching distribution found for tensorflow
FYI, my MacBook is 64-bit.
and
~ pip3 -V
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
pip 20.2.4 from /Users/zack/Library/Python/3.8/lib/python/site-packages/pip (python 3.8)
~ python3 -V
Python 3.8.2
I don't know what happened does anyone have any ideas.
According to this documentation https://www.tensorflow.org/install/pip#package-location
and your version of python you should run
python3 -m pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-2.3.0-cp38-cp38-macosx_10_14_x86_64.whl
This is the 3rd step, so check if you got installed correctly the packages from steps 1 and 2
if pip is not up-to-date upgrade pip:
pip install --upgrade pip
then install tensorflow:
pip install tensorflow
for python 3.8 you need to install tensorflow 2.2 or later
system requirements of tensorflow:
Python 3.5–3.8
Python 3.8 support requires TensorFlow 2.2 or later.
pip 19.0 or later (requires manylinux2010 support)
Ubuntu 16.04 or later (64-bit)
macOS 10.12.6 (Sierra) or later (64-bit) (no GPU support)

How to install tensorflow==2.3.0

I would like to test some function in the new tensorflow2.3 However, I am struggling with installation process.
I saw: How do I install the most recent Tensorflow (here: 2.2) on Windows when conda does not yet support it?
I executed: pip install --upgrade pip
I got:
ERROR: Could not find a version that satisfies the requirement tensorflow-cpu==2.3.0rc2 (from versions: 1.15.0rc0, 1.15.0rc1, 1.15.0rc2, 1.15.0rc3, 1.15.0, 2.1.0rc0, 2.1.0rc1, 2.1.0rc2, 2.1.0)
ERROR: No matching distribution found for tensorflow-cpu==2.3.0rc2
please make sure pip is pointing to pip3 because tensorflow requires python3
pip --version
pip3 install --upgrade tensorflow
I just ran into the same issue, but had to downgrade python from 3.9 to 3.8.
Python 3.8 is the latest version that supports tensorflow 2.3.0
For some cases, you need to upgrade your pip version
pip install --upgrade pip
then install tensorflow 2.3.0 version

Protobuf issue during TensorFlow installation

I am trying to install the TensorFlow version 0.12 which requires Protobuf 3.1.0. I also use Anaconda in which repository there is only Protobuf 3.0.0. How can I upgrade Protobuf and install TensorFlow?
The official website prints out the requirement of 3.1.0 but at the same time it provides the wrong package 3.0.0.
https://www.tensorflow.org/versions/r0.12/get_started/os_setup.html#protobuf-library-related-issues
I just changed 3.0.0 to 3.1.0 in the URL, so
https://storage.googleapis.com/tensorflow/linux/cpu/protobuf-3.1.0-cp27-none-linux_x86_64.whl
instead of
https://storage.googleapis.com/tensorflow/linux/cpu/protobuf-3.0.0-cp27-none-linux_x86_64.whl
Seems to work just fine!
pip uninstall protobuf
pip install -U protobuf
worked for me.
If you are using poetry you can update protobuf with the right versions poetry add "probuf#>=3.9.2,<3.20" and then poetry add tensorflow.
The same with pip, upgrade protobuf to the specified version and then run pip install tensorflow.
One solution is to use pip install protobuf. One can also download the whl package from https://pypi.python.org/pypi/protobuf/3.1.0 and run
pip install protobuf-3.1.0-py2.py3-none-any.whl