scikit-tda/ripser.py

Error when installing on RHEL8

DouglasJ99 opened this issue · 3 comments

When trying to install on a RHEL server, I keep getting the below error. I have ran pip install cython and pip install numpy prior to attempting to installing ripser. I have tried on a 2nd server as well (also running RHEL 8), but am getting the same result.

pip --no-cache-dir install ripser

Collecting ripser
Downloading https://files.pythonhosted.org/packages/57/a2/1f0e86b309054bbd264f6fca8f575aa682b4bdd102a73d86828f701992d3/ripser-0.5.4.tar.gz (81kB)
100% |████████████████████████████████| 81kB 4.0MB/s
Requirement already satisfied: Cython in /usr/local/lib64/python3.6/site-packages (from ripser)
Requirement already satisfied: numpy in /usr/local/lib64/python3.6/site-packages (from ripser)
Requirement already satisfied: scipy in /usr/local/lib64/python3.6/site-packages (from ripser)
Requirement already satisfied: scikit-learn in /usr/local/lib64/python3.6/site-packages (from ripser)
Requirement already satisfied: persim in /usr/local/lib/python3.6/site-packages (from ripser)
Requirement already satisfied: threadpoolctl>=2.0.0 in /usr/local/lib/python3.6/site-packages (from scikit-learn->ripser)
Requirement already satisfied: joblib>=0.11 in /usr/local/lib/python3.6/site-packages (from scikit-learn->ripser)
Requirement already satisfied: matplotlib in /usr/local/lib64/python3.6/site-packages (from persim->ripser)
Requirement already satisfied: hopcroftkarp in /usr/local/lib/python3.6/site-packages (from persim->ripser)
Requirement already satisfied: python-dateutil>=2.1 in /usr/lib/python3.6/site-packages (from matplotlib->persim->ripser)
Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib64/python3.6/site-packages (from matplotlib->persim->ripser)
Requirement already satisfied: certifi>=2020.06.20 in /usr/local/lib/python3.6/site-packages (from matplotlib->persim->ripser)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3 in /usr/local/lib/python3.6/site-packages (from matplotlib->persim->ripser)
Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.6/site-packages (from matplotlib->persim->ripser)
Requirement already satisfied: pillow>=6.2.0 in /usr/local/lib64/python3.6/site-packages (from matplotlib->persim->ripser)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.6/site-packages (from python-dateutil>=2.1->matplotlib->persim->ripser)
Installing collected packages: ripser
Running setup.py install for ripser ... error
Complete output from command /usr/bin/python3.6 -u -c "import setuptools, tokenize;file='/tmp/pip-build-0ejiqz59/ripser/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-r40wws41-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/ripser
copying ripser/init.py -> build/lib.linux-x86_64-3.6/ripser
copying ripser/_version.py -> build/lib.linux-x86_64-3.6/ripser
copying ripser/ripser.py -> build/lib.linux-x86_64-3.6/ripser
running build_ext
building 'pyRipser' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/ripser
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DUSE_COEFFICIENTS=1 -DNDEBUG=1 -DASSEMBLE_REDUCTION_MATRIX=1 -I./ripser -I/usr/include/python3.6m -I/usr/local/lib64/python3.6/site-packages/numpy/core/include -c ripser/pyRipser.cpp -o build/temp.linux-x86_64-3.6/ripser/pyRipser.o -Ofast -D_hypot=hypot -std=c++11
ripser/pyRipser.cpp:42:10: fatal error: Python.h: No such file or directory
#include "Python.h"
^~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1

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

Command "/usr/bin/python3.6 -u -c "import setuptools, tokenize;file='/tmp/pip-build-0ejiqz59/ripser/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-r40wws41-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-0ejiqz59/ripser/

Any help with this would be highly appreciated! Thanks!

I just discovered that "yum install python3-devel" also needed to be ran in order for Ripser to install successfully.

Thanks!

sauln commented

Oh that is good to know! I haven't used RHEL before so wouldn't have known. Are you interested in adding a note about this in the docs? No worries if not.

Oh that is good to know! I haven't used RHEL before so wouldn't have known. Are you interested in adding a note about this in the docs? No worries if not.

Sure, thats fine with me! Just as additional information, this is where I discovered that I was missing python devel. Just took the right googling lol
https://stackoverflow.com/questions/21530577/fatal-error-python-h-no-such-file-or-directory