【问题标题】:How to fix netifaces module installation for python2.7?如何修复 python2.7 的 netifaces 模块安装?
【发布时间】:2016-09-02 20:58:00
【问题描述】:

环境:Kali Linux 2

我开始阅读这本书“Python 网络编程食谱”,作者列出了我在本书中需要的几个模块,我能够安装除#netifaces 之外的所有模块,我尝试了“pip install netifaces”和“ python setup.py install" 方法,但都出现了这个消息:

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

我尝试安装 python-dev 和我在以前的问题中可以找到的所有库,但没有成功

感谢大家的帮助

【问题讨论】:

    标签: python python-2.7 network-programming pip python-netifaces


    【解决方案1】:

    您似乎缺少编译 netifaces 所需的 gcc。

    我以前从未使用过 Kali Linux,但你应该有 apt 所以,你可以尝试:sudo apt-get install gcc 来安装丢失的包。

    希望这能解决您的问题。

    【讨论】:

      猜你喜欢
      • 2013-10-06
      • 2014-03-26
      • 1970-01-01
      • 2016-11-03
      • 2015-04-21
      • 2023-04-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多