【发布时间】:2014-09-07 23:06:49
【问题描述】:
我用 Python3 编写了一个程序,它使用了 netifaces 包,我用 pip3 在两台装有 Ubuntu 13.04 和 Ubuntu 13.10 的计算机上安装了它。但是,我需要将它安装在其他具有 Ubuntu 12.04 的计算机上,在这里我无法安装 pip3 (python3-pip),因为它不在存储库中。
我所做的是接下来的步骤:
sudo aptitude install python3-setuptools
sudo easy_install3 pip
然后我有了 pip3 可用。问题是当我尝试使用 pip3 安装 netifaces 时,这给了我下一个错误:
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 安装 netifaces,程序将无法识别该库,因为它的文档安装在 python2 文件夹中。我什至尝试从 python3 文件夹到它们的符号链接,但它没有工作。
有什么想法吗?
【问题讨论】:
标签: python python-3.x ubuntu pip