我用Python3编写了一个程序,它使用了这个包网络面孔,我在两台装有 Ubuntu 13.04 和 Ubuntu 13.10 的计算机上使用 pip3 安装了它。但是,我需要将其安装在具有 Ubuntu 12.04 的其他计算机上,在这里我无法安装 pip3 (python3-pip),因为它不在存储库中。
我所做的是接下来的步骤:
sudo aptitude install python3-setuptools
sudo easy_install3 pip
然后我就可以使用 pip3 了。问题是当我尝试安装时网络面孔使用 pip3,这给了我下一个错误:
error: command 'gcc' failed with exit status 1
Command /usr/bin/python3 -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/netifaces/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-gkaftl-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_root/netifaces
Storing debug log for failure in /home/anubia/.pip/pip.log
如果我安装网络面孔使用 pip 或 aptitude 或 apt-get 程序无法识别该库,因为其文档安装在 python2 文件夹中。我什至尝试从 python3 文件夹到它们进行符号链接,但它不起作用。
有什么想法吗?
Solved!
我必须安装该软件包python3-dev也是,然后从 pip3 安装 netifaces 没有给我一个错误,现在我可以使用它了。
所以整个过程(就我而言)是:
sudo aptitude install python3-setuptools
sudo easy_install3 pip
sudo aptitude install python3-dev
sudo pip3 install netifaces
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)