Can't install hiredis with pip on CentOs 7
shervintech opened this issue · 3 comments
shervintech commented
I already installed python34-devel,
[vagrant@localhost vagrant]$ sudo pip install hiredis
Collecting hiredis
Using cached hiredis-0.2.0.tar.gz
Installing collected packages: hiredis
Running setup.py install for hiredis ... error
Complete output from command /usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-DJcC2F/hiredis/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-cYj42J-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/hiredis
copying hiredis/version.py -> build/lib.linux-x86_64-2.7/hiredis
copying hiredis/__init__.py -> build/lib.linux-x86_64-2.7/hiredis
running build_clib
building 'hiredis_for_hiredis_py' library
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/vendor
creating build/temp.linux-x86_64-2.7/vendor/hiredis
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -c vendor/hiredis/read.c -o build/temp.linux-x86_64-2.7/vendor/hiredis/read.o
unable to execute gcc: No such file or directory
error: command 'gcc' failed with exit status 1
ifduyue commented
@shgharib you're using pip from Python 2.7, not Python 3.4
macropin commented
ifduyue commented
yum install -y python34-devel python34-pip gcc
and then pip3.4 install hiredis
should work.
I noticed that python34 was provided by EPEL, and EPEL also provided python36. It's better to choose python36 over python34, since Python 3.4 now only accepts security fixes.