python.h在尝试安装gevent-socketio时并不喜欢

时间:2022-09-11 20:26:58

here is my error when I try to install gevent-socketio

当我尝试安装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

安装收集的软件包:gevent,greenlet运行setup.py安装,用于gevent构建'gevent.core'扩展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:致命错误:Python.h:没有这样的文件或目录编译终止。错误:命令'gcc'失败,退出状态1完成输出命令/ 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-external-managed --record / tmp / pip- _kv6Fy-record / install-record.txt:正在运行安装

running build

运行构建

running build_py

运行build_py

running build_ext

运行build_ext

building 'gevent.core' extension

建立'gevent.core'扩展

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

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。 Ø

gevent/gevent.core.c:17:20: fatal error: Python.h: No such file or directory

gevent / gevent.core.c:17:20:致命错误:Python.h:没有这样的文件或目录

compilation terminated.

编译终止。

error: command 'gcc' failed with exit status 1

错误:命令'gcc'失败,退出状态为1

Have you an idea how i can fix this?

你知道我怎么解决这个问题吗?

1 个解决方案

#1


14  

Install the Development Package(s):

安装开发包:

CentOS/RHEL::

CentOS的/ RHEL ::

yum install python-devel

Debian/Ubuntu:

于Debian / Ubuntu:

apt-get install python-dev

#1


14  

Install the Development Package(s):

安装开发包:

CentOS/RHEL::

CentOS的/ RHEL ::

yum install python-devel

Debian/Ubuntu:

于Debian / Ubuntu:

apt-get install python-dev