Getting an fatal error when installing python package on EMR notebook: Python.h: No such file or directory

Viewed 695

I need to install ahocorasick package on EMR notebook.

But when I call:

sc.install_pypi_package("pyahocorasick")

I am getting an error:

common.h:15:10: fatal error: Python.h: No such file or directory

   #include <Python.h>

            ^~~~~~~~~~

  compilation terminated.

  error: command 'gcc' failed with exit status 1

pandas installing without any problems.

I am getting the similar error when installing as a bootstrap action.

If I call:

%pip install pyahocorasick

it is installing fine, but I can not import it.

I tried this approach: fatal error: Python.h: No such file or directory, python-Levenshtein install

But I can not find any way to run sudo from the notebook.

Edit:

I tried to install gcc on bootstrape stage with the following .sh file called:

sudo yum -y install gcc
sudo yum -y install python3-devel
sudo pip3 install pyahocorasick --user

It doesn't help - I still getting error when call import ahocorasick

0 Answers
Related