python.h not found when trying to install gevent-socketio - python

here is my error when I try to install gevent-socketio
Installing collected packages: gevent, greenlet
Running setup.py install for gevent
building 'gevent.core' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes >-fPIC -DLIBEV_EMBED=1 -DEV_COMMON= -DEV_CHECK_ENABLE=0 -DEV_CLEANUP_ENABLE=0 >-DEV_EMBED_ENABLE=0 -DEV_PERIODIC_ENABLE=0 -Ibuild/temp.linux-x86_64-2.7/libev -Ilibev >-I/usr/include/python2.7 -c gevent/gevent.core.c -o build/temp.linux-x86_64-2.7/gevent/gevent.core.o
gevent/gevent.core.c:17:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
Complete output from command /usr/bin/python -c "import setuptools;file='/var/www/bleu/build/gevent/setup.py';exec(compile(open(file).read().replace('\r\n', '\n'), file, 'exec'))" install --single-version-externally-managed --record /tmp/pip-_kv6Fy-record/install-record.txt:
running install
running build
running build_py
running build_ext
building 'gevent.core' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC > -DLIBEV_EMBED=1 -DEV_COMMON= -DEV_CHECK_ENABLE=0 -DEV_CLEANUP_ENABLE=0 -DEV_EMBED_ENABLE=0 -DEV_PERIODIC_ENABLE=0 -Ibuild/temp.linux-x86_64-2.7/libev -Ilibev -I/usr/include/python2.7 -c gevent/gevent.core.c -o build/temp.linux-x86_64-2.7/gevent/gevent.core.o
gevent/gevent.core.c:17:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
Have you an idea how i can fix this?

Install the Development Package(s):
CentOS/RHEL::
yum install python-devel
Debian/Ubuntu:
apt-get install python-dev

Related

Mac OS: Catalina: unable to execute 'gcc': No such file or directory

MAC OS Catalina(10.15.1) seems to have created some problems for building code that uses gcc. I am trying to build a python application which is running into the following error.
Running setup.py install for pdftotext: started
Running setup.py install for pdftotext: finished with status 'error'
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-yzaiz97e/pdftotext/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-67h0h5_9-record/install-record.txt --single-version-externally-managed --compile:
WARNING: pkg-config not found--guessing at poppler version.
If the build fails, install pkg-config and try again.
/usr/lib64/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'long_description_content_type'
warnings.warn(msg)
running install
running build
running build_ext
building 'pdftotext' extension
creating build
creating build/temp.linux-x86_64-3.7
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 -DPOPPLER_CPP_AT_LEAST_0_30_0=1 -I/usr/include/python3.7m -c pdftotext.cpp -o build/temp.linux-x86_64-3.7/pdftotext.o -Wall
unable to execute 'gcc': No such file or directory
error: command 'gcc' failed with exit status 1
gcc is definitely installed on the system but somehow not visible to pip installer.
which gcc
/usr/bin/gcc
packaging % gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.0 (clang-1100.0.33.8)
Target: x86_64-apple-darwin19.0.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
Any help to debug the issue would be appreciated.

Unable to install blist using pip

I'm trying to install blist using pip:
pip install blist
but I'm getting the following error:
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Qunused-arguments -Qunused-arguments -fPIC -DBLIST_FLOAT_RADIX_SORT=1 -I/usr/include/python2.7 -c blist/_blist.c -o build/temp.linux-x86_64-2.7/blist/_blist.o
x86_64-linux-gnu-gcc: error: unrecognized command line option ‘-Qunused-arguments’; did you mean ‘-Wunused-parameter’?
x86_64-linux-gnu-gcc: error: unrecognized command line option ‘-Qunused-arguments’; did you mean ‘-Wunused-parameter’?
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for blist
Running setup.py clean for blist
Failed to build blist
I tried to install python-dev and setuptools, nothing changed
I tried to export flags:
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
with no success.
I'm using python 2.7, ubuntu 18.04

pip install module error

hello guys i tried to install a python module called gmpy2 with pip install gmpy2 but error occurs during wheel building
running install
running build
running build_ext
building 'gmpy2' extension
creating build
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/src
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-
prototypes -g -fdebug-prefix-map=/build/python3.6-LpWKty/python3.6-
3.6.5~rc1=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-
protector-strong -Wformat -Werror=format-security -Wdate-time -
D_FORTIFY_SOURCE=2 -fPIC -DWITHMPFR -DWITHMPC -
I/usr/include/python3.6m -c src/gmpy2.c -o build/temp.linux-x86_64-
3.6/src/gmpy2.o
In file included from src/gmpy2.c:426:0:
src/gmpy.h:252:12: fatal error: mpfr.h: No such file or directory
# include "mpfr.h"
^~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
`
`
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools,
tokenize;__file__='/tmp/pip-build-
onv0x975/gmpy2/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-izolloyr-record/install-record.txt --single-version-
externally-managed --compile" failed with error code 1 in /tmp/pip-
build-onv0x975/gmpy2/
I tried both pip and pip3
You need to download MPFR source code and compile it. See installation manual: https://gmpy2.readthedocs.io/en/latest/intro.html#installation

Error when trying to install pyamg: clang: error: no such file or directory: '“-I/.../boost_1_59_0”'

I am trying to install pyamg in my virtual environment. However, I am getting the following error. I am using mac OS.
c++: pyamg/amg_core/amg_core_wrap.cxx
clang: error: no such file or directory: '“-I/Users/mas/PycharmProjects/kaggle-ndsb/boost_1_59_0”'
clang: error: no such file or directory: '“-I/Users/mas/PycharmProjects/kaggle-ndsb/boost_1_59_0”'
error: Command "c++ -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE “-I/Users/mas/PycharmProjects/kaggle-ndsb/boost_1_59_0” -arch x86_64 -arch i386 -pipe -D__STDC_FORMAT_MACROS=1 -I/Users/mas/PycharmProjects/Whale/Zahraa5/lib/python2.7/site-packages/numpy/core/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pyamg/amg_core/amg_core_wrap.cxx -o build/temp.macosx-10.10-intel-2.7/pyamg/amg_core/amg_core_wrap.o" failed with exit status 1
Use Anaconda or Miniconda
conda install pyamg
takes only a few seconds.
You can create an environment with:
conda create --name my_env python=2.7
Change into it:
source activate my_env
and install pyamg:
conda install pyamg
You can still use pip to install packages conda cannot find.
Life is too short to spent time on compilation issues. ;)
I'm pretty sure that the -I at the beginning of the paths is what's screwing everything up. I bet if you tried adding those export statements back to .bashrc but took out the -I and -L prefixes then your original command would start working.
Perhaps you had those there for a reason, I've never seen that, but removing those prefixes would probably work.
Actually, I think #oarfish called it correctly in the comments. The problem seems to be the funny “ and ” characters in those paths, which are distinct from the usual " double quote symbol.
The following reproduces the error for me:
~$ CPPFLAGS=“-I/Users/mas/PycharmProjects/kaggle-ndsb/boost_1_59_0” \
LIBS=“-L/Users/mas/PycharmProjects/kaggle-ndsb/boost_1_59_0/stage/lib” \
pip install pyamg
Collecting pyamg
Downloading pyamg-3.0.1.tar.gz (759kB)
100% |████████████████████████████████| 761kB 33.2MB/s
Installing collected packages: pyamg
Running setup.py install for pyamg
...
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/pyamg
creating build/temp.linux-x86_64-2.7/pyamg/amg_core
compile options: '-D__STDC_FORMAT_MACROS=1 -I/home/alistair/.venvs/pyamg/local/lib/python2.7/site-packages/numpy/core/include -I/usr/include/python2.7 -c'
c++: pyamg/amg_core/amg_core_wrap.cxx
g++: error: “-I/Users/mas/PycharmProjects/kaggle-ndsb/boost_1_59_0”: No such file or directory
g++: error: “-I/Users/mas/PycharmProjects/kaggle-ndsb/boost_1_59_0”: No such file or directory
error: Command "c++ -pthread -DNDEBUG -g -fwrapv -O2 -Wall -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security “-I/Users/mas/PycharmProjects/kaggle-ndsb/boost_1_59_0” -fPIC -D__STDC_FO
RMAT_MACROS=1 -I/home/alistair/.venvs/pyamg/local/lib/python2.7/site-packages/numpy/core/include -I/usr/include/python2.7 -c pyamg/amg_core/amg_core_wrap.cxx -o build/temp.linux-x86_64-2.7/pyamg/amg_core/amg_core_wrap.o" failed with exit
status 1
----------------------------------------
Command "/home/alistair/.venvs/pyamg/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-Cl5_2g/pyamg/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" insta
ll --record /tmp/pip-kkjcoa-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/alistair/.venvs/pyamg/include/site/python2.7/pyamg" failed with error code 1 in /tmp/pip-build-Cl5_2g/pyamg
Whereas with " symbols the installation succeeds:
~$ CPPFLAGS="-I/Users/mas/PycharmProjects/kaggle-ndsb/boost_1_59_0" \
LIBS="-L/Users/mas/PycharmProjects/kaggle-ndsb/boost_1_59_0/stage/lib" \
pip install pyamg
Collecting pyamg
Using cached pyamg-3.0.1.tar.gz
Installing collected packages: pyamg
Running setup.py install for pyamg
Successfully installed pyamg-3.0.1
The paths themselves are irrelevant - the compilation succeeds in spite of the fact that those directories don't actually exist on my machine.

aspell-python installation error

I am trying to install aspell-python package for spell correction.
Facing problem while installing the package.
Error :
python setup.py install
running install
running build
running build_ext
building 'aspell' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c aspell.c -o build/temp.linux-i686-2.7/aspell.o
aspell.c:53:20: fatal error: aspell.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
GCC is already install version gcc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2
libaspell15 is already install
Need to install sudo apt-get install libaspell-dev

Categories