Failed building wheel for spacy

孤街浪徒 提交于 2019-11-28 08:20:57

A couple thoughts:

for me, pip install --no-cache-dir spacy worked

I installed these packages, then it works:

sudo apt-get install python-dev 
sudo apt-get install python3-dev 
sudo apt-get install libevent-dev

This worked for me:

# Note, use sudo. I'm in a docker image, so i dont need it.

# install dev libs
apt-get install python-dev -y && \
apt-get install python3-dev -y && \
apt-get install libevent-dev -y && \

# install new gcc
apt-get update && \
apt-get install build-essential software-properties-common -y && \
add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
apt-get update && \
apt-get install gcc-snapshot -y && \
apt-get update && \
apt-get install gcc-6 g++-6 -y && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6 && \
apt-get install gcc-4.8 g++-4.8 -y && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8;

see https://gist.github.com/application2000/73fd6f4bf1be6600a2cf9f56315a2d91

If you are on Ubuntu, just do this

sudo apt-get install build-essential python-dev git

Now install spacy by

pip install -U spacy

Download and install from the Gihub source. Here is the link: https://github.com/explosion/spaCy

Use these commands:

python -m pip install -U pip venv              # update pip & virtualenv
git clone https://github.com/explosion/spaCy   # clone spaCy
cd spaCy                                       # navigate into directory

venv .env                                      # create environment in .env
source .env/bin/activate                       # activate virtual environment
export PYTHONPATH=`pwd`                        # set Python path to spaCy directory
pip install -r requirements.txt                # install all requirements
python setup.py build_ext --inplace            # compile spaCy

Feel free to use only last two commands if not using virtual environment. Follow the official Documentation here

If you are using it with manually installed python3.6 and trying to install in a 3.6 environment then you maybe missing python3.6-dev

sudo apt-get install python3.6-dev

also maybe

sudo apt-get install gcc

This is an answer to particular case.

conda install -c conda-forge spacy worked for me. I have windows 10 and Python 3.5.3 :: Anaconda custom (64-bit)

yum -y groupinstall development

WORKED FOR ME

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!