Spacy: Installing Spacy fails Amazon Linux AMI release 2018.03, Python3.6

Created on 17 Jul 2018  Â·  7Comments  Â·  Source: explosion/spaCy

I have tried installing spacy using the pip, it failed and returns the following error

gcc: error trying to exec 'cc1plus': execvp: No such file or directory error: command 'gcc' failed with exit status 1

gcc: error: murmurhash/mrmr.cpp: No such file or directory gcc: fatal error: no input files compilation terminated. error: command 'gcc' failed with exit status 1

Python headers library installed : python36-devel.x86_64
gcc-c++ package : gcc-c++-4.8.5-1.22.amzn1.noarch

Any help really appreciated. Thank you!

My Environment

  • Operating System: Amazon Linux AMI release 2018.03
  • Python Version Used: Python 3.6
  • spaCy Version Used: 2.0.11

Error Details

` gcc: error trying to exec 'cc1plus': execvp: No such file or directory
error: command 'gcc' failed with exit status 1


Failed building wheel for spacy
Running setup.py clean for spacy
Running setup.py bdist_wheel for murmurhash ... error
Complete output from command /home/ec2-user/rasa_nlu_36/bin/python36 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-75x_edhz/murmurhash/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-bil_w8dn --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
error: command 'gcc' failed with exit status 1


Failed building wheel for murmurhash
Running setup.py clean for murmurhash
Running setup.py bdist_wheel for cymem ... error
Complete output from command /home/ec2-user/rasa_nlu_36/bin/python36 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-75x_edhz/cymem/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-9kuiiinz --python-tag cp36:
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
error: command 'gcc' failed with exit status 1


Failed building wheel for cymem
Running setup.py clean for cymem
Running setup.py bdist_wheel for preshed ... error
Complete output from command /home/ec2-user/rasa_nlu_36/bin/python36 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-75x_edhz/preshed/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-y58gfl39 --python-tag cp36:
running bdist_wheel
running build
running build_py
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.6m -I/tmp/pip-install-75x_edhz/preshed/include -I/home/ec2-user/rasa_nlu_36/include -I/usr/include/python3.6m -c preshed/maps.cpp -o build/temp.linux-x86_64-3.6/preshed/maps.o -O3 -Wno-strict-prototypes -Wno-unused-function
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
error: command 'gcc' failed with exit status 1`


Failed building wheel for preshed
Running setup.py clean for preshed
Running setup.py bdist_wheel for thinc ... error
Complete output from command /home/ec2-user/rasa_nlu_36/bin/python36 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-75x_edhz/thinc/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-tnvhr054 --python-tag cp36:
Warning: The nvcc binary could not be located in your $PATH. For GPU capability, either add it to your path, or set $CUDA_HOME
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.6m -I/tmp/pip-install-75x_edhz/thinc/include -I/home/ec2-user/rasa_nlu_36/include -I/usr/include/python3.6m -c thinc/linalg.cpp -o build/temp.linux-x86_64-3.6/thinc/linalg.o -O3 -Wno-strict-prototypes -Wno-unused-function
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
error: command 'gcc' failed with exit status 1`


Failed building wheel for thinc Running setup.py clean for thinc Failed to build spacy murmurhash cymem preshed thinc Installing collected packages: murmurhash, cymem, preshed, wrapt, toolz, cytoolz, plac, dill, termcolor, msgpack-python, msgpack-numpy, thinc, ujson, regex, spacy Running setup.py install for murmurhash ... error Complete output from command /home/ec2-user/rasa_nlu_36/bin/python36 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-75x_edhz/murmurhash/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-1w77450l/install-record.txt --single-version-externally-managed --compile --install-headers /home/ec2-user/rasa_nlu_36/include/site/python3.6/murmurhash: running install running build running build_py running build_ext building 'murmurhash.mrmr' extension gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.6m -I/tmp/pip-install-75x_edhz/murmurhash/murmurhash/include -I/home/ec2-user/rasa_nlu_36/include -I/usr/include/python3.6m -c murmurhash/mrmr.cpp -o build/temp.linux-x86_64-3.6/murmurhash/mrmr.o -O3 -Wno-strict-prototypes -Wno-unused-function gcc: error: murmurhash/mrmr.cpp: No such file or directory gcc: fatal error: no input files compilation terminated. error: command 'gcc' failed with exit status 1

----------------------------------------

Command "/home/ec2-user/rasa_nlu_36/bin/python36 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-75x_edhz/murmurhash/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-1w77450l/install-record.txt --single-version-externally-managed --compile --install-headers /home/ec2-user/rasa_nlu_36/include/site/python3.6/murmurhash" failed with error code 1 in /tmp/pip-install-75x_edhz/murmurhash

install linux

Most helpful comment

@parthibane Thanks for updating with the solution! (I hadn't seen that error before and it sounds frustrating – sorry about that. We hope that we'll be able to provide more pre-built wheels soon so users won't always have to compile it locally when installing from pip.)

All 7 comments

Running into the same issue, tried conda now and now running into issues downloading models.

Finally found the root cause! gcc cannot find cc1plus and fixed with help of below link. https://stackoverflow.com/questions/36353302/gcc-cannot-find-cc1plus

@parthibane Thanks for updating with the solution! (I hadn't seen that error before and it sounds frustrating – sorry about that. We hope that we'll be able to provide more pre-built wheels soon so users won't always have to compile it locally when installing from pip.)

Someone print this and send it to AWS linux team. They seem to not follow any standard convention for library and header locations and links... (not even mentioning overriding global env variables that no one uses and breaks a lot of stuff)

I had same error, and have followed this instruction and did
sudo ln -s /usr/libexec/gcc/x86_64-redhat-linux/4.4.4/cc1plus /usr/local/bin/
however I still get the same error as before.

``` creating build/temp.linux-x86_64-3.6/thinc
gcc -pthread -B /home/ec2-user/anaconda3/envs/allennlp/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/ec2-user/anaconda3/envs/allennlp/include/python3.6m -I/tmp/pip-install-d79yte2u/thinc/include -I/home/ec2-user/anaconda3/envs/allennlp/include/python3.6m -c thinc/linalg.cpp -o build/temp.linux-x86_64-3.6/thinc/linalg.o -O3 -Wno-strict-prototypes -Wno-unused-function
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
error: command 'gcc' failed with exit status 1


Failed building wheel for thinc
Running setup.py clean for thinc
Failed to build spacy murmurhash cymem preshed thinc
Installing collected packages: murmurhash, cymem, preshed, msgpack, msgpack-numpy, toolz, cytoolz, wrapt, plac, dill, thinc, ujson, regex, spacy
Running setup.py install for murmurhash ... error
Complete output from command /home/ec2-user/anaconda3/envs/allennlp/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-d79yte2u/murmurhash/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-1he9pgzd/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
running build_ext
building 'murmurhash.mrmr' extension
gcc -pthread -B /home/ec2-user/anaconda3/envs/allennlp/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/ec2-user/anaconda3/envs/allennlp/include/python3.6m -I/tmp/pip-install-d79yte2u/murmurhash/murmurhash/include -I/home/ec2-user/anaconda3/envs/allennlp/include/python3.6m -c murmurhash/mrmr.cpp -o build/temp.linux-x86_64-3.6/murmurhash/mrmr.o -O3 -Wno-strict-prototypes -Wno-unused-function
gcc: error: murmurhash/mrmr.cpp: No such file or directory
error: command 'gcc' failed with exit status 1

----------------------------------------

Command "/home/ec2-user/anaconda3/envs/allennlp/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-d79yte2u/murmurhash/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-1he9pgzd/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-d79yte2u/murmurhash/```

I had the same problem, it was because I didn't have g++ installed (gcc-c++ on Fedora).

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings