Thriftpy / thriftpy2

Pure python approach of Apache Thrift.
MIT License
572 stars 91 forks source link

Python3.6.5 intall error #150

Closed TrentChou closed 3 years ago

TrentChou commented 3 years ago

C/C++ environment

g++ (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)

gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)

Error:

    running build_ext
    building 'thriftpy2.transport.cybase' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/thriftpy2
    creating build/temp.linux-x86_64-3.6/thriftpy2/transport
    gcc -pthread -Wno-unused-result -Wsign-compare -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 -I/usr/include/python3.6m -c thriftpy2/transport/cybase.c -o build/temp.linux-x86_64-3.6/thriftpy2/transport/cybase.o
    thriftpy2/transport/cybase.c:17: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 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-hw40w4gx/thriftpy2/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-weyadg7j-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-hw40w4gx/thriftpy2/

I have fix the python3 by intalling python-devel whose version is correct

ethe commented 3 years ago

You should install python-dev/python-devel before installation because thriftpy uses cython, see https://stackoverflow.com/questions/21530577/fatal-error-python-h-no-such-file-or-directory

TrentChou commented 3 years ago

You should install python-dev/python-devel before installation because thriftpy uses cython, see https://stackoverflow.com/questions/21530577/fatal-error-python-h-no-such-file-or-directory

thx, Method is effective