安装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/

Python.h: No such file or directory相关推荐

  1. fatal error: Python.h: No such file or directory 解决

    [常见错误] fatal error: Python.h: No such file or directory 环境场景 系统: Parrot Linux 软件: 系统python默认版本2.7 Py ...

  2. [常见错误]Python.h: No such file or directory

    这个错误是通过source code安装PyGeSQL时遇到的 [root@centos6u2 PyGreSQL-4.0]# python setup.py build running build r ...

  3. python mysql python.h_MySQLdb/_mysql.c:38:20: fatal error: Python.h: No such file or directory

    一.描述 在centos7.5中执行pip3 install mysqlclient,报如下错误 [root@VM_0_10_centos data]# pip3 install mysqlclien ...

  4. 遇见Python.h: No such file or directory的解决方法

    遇见Python.h: No such file or directory的解决方法 参考文章: (1)遇见Python.h: No such file or directory的解决方法 (2)ht ...

  5. 【scrapy】Ubuntu安装scrapy报错:fatal error: Python.h: No such file or directory

    src/twisted/test/raiser.c:4:10: fatal error: Python.h: No such file or directory#include "Pytho ...

  6. uwsgi 安装报错 plugins/python/uwsgi_python.h:2:20: fatal error: Python.h: No such file or directory

    1. Python3 安装 uwsgi 报错 直接使用命令 sudo pip3 install uwsgi 安装如下错误: ubuntu@ubuntu:~/Downloads$ sudo pip3 i ...

  7. ubuntu 安装scrapy error :wisted/test/raiser.c:4:20: fatal error: Python.h: No such file or directory

    wisted/test/raiser.c:4:20: fatal error: Python.h: No such file or directocompilation terminated.erro ...

  8. (诊断)处理错误fatal error: Python.h: No such file or directory

    安装与Python版本对应的 python-dev 即可,比如: $ sudo apt-get install python2.7-dev 转载于:https://www.cnblogs.com/Se ...

  9. fatal error: Python.h: No such file or directory

    ubuntu下编译libxml2时,报错. 执行apt-get install python-dev即可

最新文章

  1. android 美颜 技术点,《Android 美颜类相机开发汇总》第六章 Android OpenGLES 美妆定制实现...
  2. 独家 | 如何全面解析数据并创造数据故事
  3. ssh登陆分布式服务器进行编程
  4. 如何在JavaScript中实现堆栈和队列?
  5. 敏捷开发_全面解析瀑布式开发和敏捷式开发
  6. Java连接FTP服务器并且实现对其文件的上传和下载
  7. 网络学习(二十七)Windows XP 加入 Windows Server 2003 Active Directory
  8. invalid currency could not be saved in AG3
  9. 【ArcGIS遇上Python】ArcGIS批量为多个矢量图层添加一个或多个字段(Add Field)案例实现
  10. 【机器学习实战之一】:C++实现K-近邻算法KNN
  11. bzoj 4942 整数 思考记录
  12. Thinapp的昨天,今天和明天
  13. 追逐鼠标光标的好奇小猫咪
  14. linux安装英特尔AX200网卡驱动
  15. DirectShow介绍
  16. 第五届强网杯全国网络安全挑战赛 题目复现(有题目附件,详解)
  17. python迷宫万花筒代码_Python实现PS滤镜的万花筒效果示例,python万花筒
  18. xbox360自建服务器,Xbox360自制系统GOD版的游戏怎么安装
  19. mysql存储过程之错误处理
  20. 我的三年自学深度学习之路

热门文章

  1. Linux 高可用(HA)集群之keepalived+lvs
  2. linux shell bash 内置变量参考
  3. CSS文档流与块级元素和内联元素
  4. 如何判断数据库的某个字段不为空方法
  5. leetcod003 Longest_Substring_Without_Repeating
  6. 各种flash的不同
  7. 微型计算机的EMC设计视频,干货 | EMC设计有多难,看完这31个电磁兼容标准电路,瞬间懂了...
  8. html景图片怎么设置百分比,8个风光照片拍摄技巧
  9. win10清理_大家都说Win10系统不用装360,那么如何清理电脑软件垃圾呢?
  10. linux expect 输入密码,shell脚本无密码登录 expect的使用方法详解