开发者社区> 天飞.h> 正文

Python.h: No such file or directory

简介: 安装python-devel包解决这个问题 # pip install netifaces     DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python.
+关注继续查看
安装python-devel包解决这个问题

# pip install netifaces    
DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
Collecting netifaces
  Using cached netifaces-0.10.5.tar.gz
Installing collected packages: netifaces
  Running setup.py install for netifaces ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-2ZS95g/netifaces/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-e1XD5C-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    checking for getifaddrs...found.
    checking for getnameinfo...found.
    checking for IPv6 socket IOCTLs...not found.
    checking for optional header files...netash/ash.h netatalk/at.h netax25/ax25.h neteconet/ec.h netipx/ipx.h netpacket/packet.h linux/irda.h linux/atm.h linux/llc.h linux/tipc.h linux/dn.h.
    checking whether struct sockaddr has a length field...no.
    checking which sockaddr_xxx structs are defined...at ax25 in in6 ipx un ash ec ll atmpvc atmsvc dn irda llc.
    checking for routing socket support...no.
    checking for sysctl(CTL_NET...) support...no.
    checking for netlink support...yes.
    will use netlink to read routing table
    building 'netifaces' extension
    gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DNETIFACES_VERSION=0.10.5 -DHAVE_GETIFADDRS=1 -DHAVE_GETNAMEINFO=1 -DHAVE_NETASH_ASH_H=1 -DHAVE_NETATALK_AT_H=1 -DHAVE_NETAX25_AX25_H=1 -DHAVE_NETECONET_EC_H=1 -DHAVE_NETIPX_IPX_H=1 -DHAVE_NETPACKET_PACKET_H=1 -DHAVE_LINUX_IRDA_H=1 -DHAVE_LINUX_ATM_H=1 -DHAVE_LINUX_LLC_H=1 -DHAVE_LINUX_TIPC_H=1 -DHAVE_LINUX_DN_H=1 -DHAVE_SOCKADDR_AT=1 -DHAVE_SOCKADDR_AX25=1 -DHAVE_SOCKADDR_IN=1 -DHAVE_SOCKADDR_IN6=1 -DHAVE_SOCKADDR_IPX=1 -DHAVE_SOCKADDR_UN=1 -DHAVE_SOCKADDR_ASH=1 -DHAVE_SOCKADDR_EC=1 -DHAVE_SOCKADDR_LL=1 -DHAVE_SOCKADDR_ATMPVC=1 -DHAVE_SOCKADDR_ATMSVC=1 -DHAVE_SOCKADDR_DN=1 -DHAVE_SOCKADDR_IRDA=1 -DHAVE_SOCKADDR_LLC=1 -DHAVE_PF_NETLINK=1 -I/usr/include/python2.6 -c netifaces.c -o build/temp.linux-x86_64-2.6/netifaces.o
    netifaces.c:1:20: error: Python.h: No such file or directory
    netifaces.c: In function ‘string_from_sockaddr’:
    netifaces.c:341: warning: implicit declaration of function ‘calloc’
    netifaces.c:341: warning: incompatible implicit declaration of built-in function ‘calloc’
    netifaces.c:344: warning: implicit declaration of function ‘memcpy’
    netifaces.c:344: warning: incompatible implicit declaration of built-in function ‘memcpy’
    netifaces.c:360: warning: implicit declaration of function ‘free’
    netifaces.c:360: warning: incompatible implicit declaration of built-in function ‘free’
    netifaces.c:405: warning: implicit declaration of function ‘sprintf’
    netifaces.c:405: warning: incompatible implicit declaration of built-in function ‘sprintf’
    netifaces.c: In function ‘string_from_netmask’:
    netifaces.c:491: warning: incompatible implicit declaration of built-in function ‘sprintf’
    netifaces.c:493: warning: implicit declaration of function ‘strlen’
    netifaces.c:493: warning: incompatible implicit declaration of built-in function ‘strlen’
    netifaces.c:494: warning: implicit declaration of function ‘strcpy’
    netifaces.c:494: warning: incompatible implicit declaration of built-in function ‘strcpy’
    netifaces.c: At top level:
    netifaces.c:672: error: expected ‘)’ before ‘*’ token
    netifaces.c:710: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    netifaces.c:1269: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    netifaces.c:1442: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    netifaces.c:2516: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘methods’
    netifaces.c: In function ‘initnetifaces’:
    netifaces.c:2546: error: ‘PyObject’ undeclared (first use in this function)
    netifaces.c:2546: error: (Each undeclared identifier is reported only once
    netifaces.c:2546: error: for each function it appears in.)
    netifaces.c:2546: error: ‘address_family_dict’ undeclared (first use in this function)
    netifaces.c:2547: error: ‘m’ undeclared (first use in this function)
    netifaces.c:2555: warning: implicit declaration of function ‘Py_InitModule3’
    netifaces.c:2555: error: ‘methods’ undeclared (first use in this function)
    netifaces.c:2560: warning: implicit declaration of function ‘PyDict_New’
    netifaces.c:2562: warning: implicit declaration of function ‘PyModule_AddIntConstant’
    netifaces.c:2563: warning: implicit declaration of function ‘PyDict_SetItem’
    netifaces.c:2563: warning: implicit declaration of function ‘PyInt_FromLong’
    netifaces.c:2564: warning: implicit declaration of function ‘PyString_FromString’
    netifaces.c:2871: warning: implicit declaration of function ‘PyModule_AddObject’
    netifaces.c:2879: warning: implicit declaration of function ‘PyModule_AddStringConstant’
    error: command 'gcc' failed with exit status 1
    
    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-2ZS95g/netifaces/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-e1XD5C-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-2ZS95g/netifaces/

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
如何设置阿里云服务器安全组?阿里云安全组规则详细解说
阿里云安全组设置详细图文教程(收藏起来) 阿里云服务器安全组设置规则分享,阿里云服务器安全组如何放行端口设置教程。阿里云会要求客户设置安全组,如果不设置,阿里云会指定默认的安全组。那么,这个安全组是什么呢?顾名思义,就是为了服务器安全设置的。安全组其实就是一个虚拟的防火墙,可以让用户从端口、IP的维度来筛选对应服务器的访问者,从而形成一个云上的安全域。
19073 0
阿里云服务器如何登录?阿里云服务器的三种登录方法
购买阿里云ECS云服务器后如何登录?场景不同,阿里云优惠总结大概有三种登录方式: 登录到ECS云服务器控制台 在ECS云服务器控制台用户可以更改密码、更换系.
28292 0
阿里云服务器安全组设置内网互通的方法
虽然0.0.0.0/0使用非常方便,但是发现很多同学使用它来做内网互通,这是有安全风险的,实例有可能会在经典网络被内网IP访问到。下面介绍一下四种安全的内网互联设置方法。 购买前请先:领取阿里云幸运券,有很多优惠,可到下文中领取。
22181 0
阿里云服务器ECS登录用户名是什么?系统不同默认账号也不同
阿里云服务器Windows系统默认用户名administrator,Linux镜像服务器用户名root
15761 0
阿里云服务器端口号设置
阿里云服务器初级使用者可能面临的问题之一. 使用tomcat或者其他服务器软件设置端口号后,比如 一些不是默认的, mysql的 3306, mssql的1433,有时候打不开网页, 原因是没有在ecs安全组去设置这个端口号. 解决: 点击ecs下网络和安全下的安全组 在弹出的安全组中,如果没有就新建安全组,然后点击配置规则 最后如上图点击添加...或快速创建.   have fun!  将编程看作是一门艺术,而不单单是个技术。
20272 0
阿里云服务器怎么设置密码?怎么停机?怎么重启服务器?
如果在创建实例时没有设置密码,或者密码丢失,您可以在控制台上重新设置实例的登录密码。本文仅描述如何在 ECS 管理控制台上修改实例登录密码。
23541 0
腾讯云服务器 设置ngxin + fastdfs +tomcat 开机自启动
在tomcat中新建一个可以启动的 .sh 脚本文件 /usr/local/tomcat7/bin/ export JAVA_HOME=/usr/local/java/jdk7 export PATH=$JAVA_HOME/bin/:$PATH export CLASSPATH=.
14878 0
+关注
天飞.h
脚踏实地,仰望天空. https://talenhao.github.io/
260
文章
0
问答
文章排行榜
最热
最新
相关电子书
更多
JS零基础入门教程(上册)
立即下载
性能优化方法论
立即下载
手把手学习日志服务SLS,云启实验室实战指南
立即下载