简体   繁体   English

如何修复python2.7的netifaces模块安装?

[英]How to fix netifaces module installation for python2.7?

Environment : Kali Linux 2 环境:Kali Linux 2

I started reading this book "Python network programming cookbook" and the writers listed few modules I am gonna need during the book i was able to install all of them except #netifaces, I tried both the "pip install netifaces" and "python setup.py install" methods but both made appear this message: 我开始阅读这本书“Python网络编程烹饪书”,作者列出了我在本书中需要安装的几个模块,我能够安装所有这些模块,除了#netifaces,我尝试了“pip install netifaces”和“python setup”。 py安装“方法,但两个都显示此消息:

x86_64-linux-gnu-gcc: error trying to exec 'cc1': execvp: No such file or directory

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-lsf_5N/netifaces/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-TsHwUh-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-build-lsf_5N/netifaces
Storing debug log for failure in /root/.pip/pip.log

I tried to install python-dev and all the libraries I could find in previous asked questions here but nothing made it happen 我试图在这里安装python-dev和我在之前提出的问题中找到的所有库,但没有任何事情发生

Thank you all for your help 谢谢大家的帮助

It looks like you are missing gcc, which is needed to compile netifaces. 看起来你缺少gcc,这是编译netifaces所必需的。

I've never used Kali Linux before but you should have apt so, you can try: sudo apt-get install gcc to install the missing package. 我之前从未使用过Kali Linux,但你应该这样,你可以尝试: sudo apt-get install gcc来安装丢失的包。

Hopefully this solves your problem. 希望这能解决您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM