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/

目录
相关文章
|
1月前
|
开发者 Python
Python学习九:file操作
这篇文章是关于Python文件操作的详细教程,包括文件的打开、读写、关闭,以及文件备份脚本的编写和文件定位操作。
18 2
|
1月前
|
存储 安全 Java
Python File处理详解!
本文详细介绍了Python文件处理的方法及其优缺点。通过`open()`、`read()`、`write()`和`append()`等函数,Python能够轻松实现文件的创建、读取、写入及追加等操作。文章还展示了如何使用`tell()`获取文件指针位置,并提供了涵盖文件创建、读取、追加、重命名及删除的完整示例。Python文件处理不仅功能强大且跨平台兼容,但也存在易错性、安全风险及处理大文件时的性能问题。适合数据存储、配置管理和数据分析等多种应用场景。
38 4
|
3月前
|
Linux Python Windows
【Azure 环境】Windows中安装Python azure-eventhub-checkpointstoreblob-aio模块时出错 ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory:
【Azure 环境】Windows中安装Python azure-eventhub-checkpointstoreblob-aio模块时出错 ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory:
|
3月前
|
Python
python 升级后 yum 无法使用 File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: `/usr/libexec/urlgrabber-ext-down`
python 升级后 yum 无法使用 File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: `/usr/libexec/urlgrabber-ext-down`
33 0
|
4月前
|
UED Python
【Python】已解决:FileNotFoundError: [Errno 2] No such file or directory: ‘D:\1. PDF’
【Python】已解决:FileNotFoundError: [Errno 2] No such file or directory: ‘D:\1. PDF’
134 0
|
4月前
|
程序员 开发者 Python
【Python】已解决:Traceback (most recent call last): File “C:/python/kfc.py”, line 8, in KfcError: KFC Cra
【Python】已解决:Traceback (most recent call last): File “C:/python/kfc.py”, line 8, in KfcError: KFC Cra
257 0
|
4月前
|
XML 数据格式 Python
【Python】已解决:FileNotFoundError: [Errno 2] No such file or directory: ‘./1.xml’
【Python】已解决:FileNotFoundError: [Errno 2] No such file or directory: ‘./1.xml’
152 0
|
4月前
|
开发者 Python
【Python】已解决:FileNotFoundError: [Errno 2] No such file or directory: ‘配置信息.csv‘
【Python】已解决:FileNotFoundError: [Errno 2] No such file or directory: ‘配置信息.csv‘
207 0
|
Python Windows
Python全栈之路:文件file常用操作
Python全栈之路:文件file常用操作
Python全栈之路:文件file常用操作
|
移动开发 Python Windows
Python全栈之路:文件file常用操作
Python全栈之路:文件file常用操作
165 0