4

I'm trying to load spacy into SageMaker. I run the following in Jupyter notebook instance

!pip install spacy

I end up getting this error

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

and this as well

gcc: error: murmurhash/mrmr.cpp: No such file or directory
error: command 'gcc' failed with exit status 1

How can I resolve this issue withing Sagemaker?

SgtPooki
  • 11,012
  • 5
  • 37
  • 46
Sujay DSa
  • 1,172
  • 2
  • 22
  • 37

3 Answers3

2

I was experiencing similar problems when I started using SageMaker so I developed this open source project https://github.com/Kenza-AI/sagify (sagify), it's a CLI tool that can help you train and deploy your own Machine Learning/Deep Learning models on SageMaker in a very easy way. I managed to train and deploy all of my ML models whatever library I was using (Keras, Tensorflow, scikit-learn, LightFM, spacy, etc). Essentially, you can specify all your dependencies in the classic pythonic way, i.e. in a requiments.txt, and sagify will read them and install them on a Docker image. Then, this Docker image can be executed on SageMaker for training and deployment.

pm3310
  • 119
  • 1
  • 2
  • 9
0

From https://stackoverflow.com/a/38733918/3276830

Fix gcc

sudo apt-get update
sudo apt-get install --reinstall build-essential

I am not sure about second error, maybe murmurhash/mrmr.cpp does not exist?

Varun Garg
  • 2,464
  • 23
  • 37
  • I had tried this. apt-get is not recognized. So I tried yum install instead. but I get no package build-essential available – Sujay DSa Apr 05 '18 at 07:00
  • 2
    On yum, try out `yum install gcc-c++` – Varun Garg Apr 05 '18 at 07:01
  • 2
    If that also fails, try `sudo yum install gcc-c++.noarch` – Varun Garg Apr 05 '18 at 07:03
  • Loaded plugins: dkms-build-requires, priorities, update-motd, upgrade-helper 1039 packages excluded due to repository priority protections Package gcc-c++-4.8.5-1.22.amzn1.noarch already installed and latest version Nothing to do – Sujay DSa Apr 05 '18 at 07:05
  • It should have worked, I can't say much more, you may also see this answer: https://stackoverflow.com/a/48925817/3276830 , it is recent. – Varun Garg Apr 05 '18 at 07:21
-1

You can try following commands to install spacy, using Jupyter cell selecting Python3 kernel

!conda update --all -y 
!conda install -n python3 -y -c conda-forge spacy

and then restart the kernel.

After restarting the kernel you should be able to import spacy. Or you can issue the same above commands using Jupyter terminal, just remove ! mark when issuing commands from the above.