2015-01-13 219 views

回答

1

這與在netifaces setup.py中導入庫的順序有關,並在版本10.3+(需要從源代碼安裝)中修復。下面是如何安裝10.4(當前最新版本):

mkdir -p /tmp/install/netifaces/ 
cd /tmp/install/netifaces && wget -O "netifaces-0.10.4.tar.gz" "https://pypi.python.org/packages/source/n/netifaces/netifaces-0.10.4.tar.gz#md5=36da76e2cfadd24cc7510c2c0012eb1e" 
tar xvzf netifaces-0.10.4.tar.gz 
cd netifaces-0.10.4 && python setup.py install 
+0

我剛剛嘗試使用netifaces-0.10.4.tar.gz從全新的cygwin x86安裝,並且失敗時出現同樣的錯誤。更奇怪的是,它在安裝了大量其他軟件包的x64 cygwin上運行。 –

+0

W ............. T ............... F:python是*絕對最差的*。 – devth

0

我降落在這個問題上,在做類似的事情:

pip install rackspace-novaclient 

而這就是看着我的錯誤,如:

Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-G5GwYu/netifaces/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Jugr2a-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-G5GwYu/netifaces 

讀完整個輸出日誌後,我意識到我錯過了「gcc」,只需要安裝它。

在CentOS 7,我的修補程序是:

yum -y install gcc && pip install rackspace-novaclient 
2

我也有這個問題,並在AWX項目(Centos的7)awx_task容器由 sudo yum install python-devel python-pip sudo yum -y install gcc

1

同樣的問題解決了,試圖執行

pip install python-openstackclient 

錯誤:

Command "/usr/bin/python2 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-LTchWP/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-86uBIZ-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-LTchWP/netifaces/ 

解決了:

yum install python-devel python-pip gcc 

希望這將幫助別人!